Was hoping to get help with an Arcade Calculator issue. I have two field names I am referencing and 4 possible outcomes to populate a new text field.
I have an integer field as well as a text field that is domain driven. The end result is a simple text return: (Pass, Fail, No Locate, Other).
If the number field = 1, and domain field = Full, then = Pass
If the number field = 1, and domain field = Dim, then = Fail... and so on.
Any Arcade wizards out there willing to help? I made a couple rough attempts, but am having trouble with referencing 2 different fields.
Thanks!
One problem you might be running into is when you're using a domain, you have to either make your evaluation with its label or use DomainName to use its code.
For example if DomainField is set up like
Label | Code |
---|---|
1 | Full |
2 | Dim |
then you'd either use
if ($feature.DomainField == 1)
or
if (DomainName($feature,'DomainField') == 'Full')
For your calculator, one way of evaluating your two variable would look something like this
if ($feature.NumberField == 1) {
if ($feature.DomainField == 1) { // if (DomainName($feature,'DomainField') == 'Full')
return 'Pass';
} else if (if ($feature.DomainField == 2) { //if (DomainName($feature,'DominField') == 'Dim')
return 'Fail';
}
}
//etc
Thank you Ken Buja, got it to work.