1

I have a calculation attribute rule in Arcade that is meant to have the following fields work in conjunction with each other:

Name: eight digit unique ID

AMPageName: 5 digit page name that consists of the first five digits of Name field (for most cases)

AMPageNameAutoCALC: A long type, trigger field (Yes/No, 1 for yes) used to work with the attribute rule to automatically calculate the first 5 digits of the name field to the AMPageName field.

I need to fix the current coding of the expression to allow for the AMPageName to have values manually entered in that are 'necessary outlying' cases that don't always require an automatic calculation, but should be manually entered.

if (Includes([1], $feature.AMPageName_AutoCALC )){
Left($feature.Name,5)
} else {
  return true;
}

The above expression works fine, but for records that I intend to NOT have applied to the calculation by entering in "0" for no or Null, they are left attributed as "true"

In other words, what can I enter in other than "return true;" to allow for manual entry of records in that field?

attribute pane sample of desired and undesired results

2 Answers 2

1

The rule is setting the value to 'true' because Boolean is not one of the return types of the calculation rule expression and it's implicitly casting to text instead.

You can either return a value you'd want, or you can return $feature.AMPageName to leave it unchanged.

0
0

Thanks, I was able to resolve it by the following expression:

if (Includes([1], $feature.AMPageName_AutoCALC )){ Left($feature.Name,5) }

This way, features tagged with "Yes" in the AutoCALC field are subject to automatic calculation, while features that need to be manually entered can have a different trigger value that maintains automatic calculation on the majority of features.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.