Is there an arcade expression for "feature includes value", instead of != or ==
I have a feature that is used during an inspection to identify issues with a facility. When crews go back to fix the issues identified during the inspection, there is a text field for each of the predetermined issues that they use to note what they did to resolve the issue (for example, Issues include Corrosion, Code Violation, and Landscape Conflict - additional attribute fields are Corrosion Resolution, Code Violation Resolution, and Landscape Conflict Resolution)
For example, if the "Issues" field of my feature looks like this:
ObjectID | Issues |
1 | Corrosion, Code Violation |
2 | Corrosion |
3 | Corrosion, Code Violation, Landscape Conflict |
I want to configure Conditional Visibility in a Field Maps form to only show a Code Violation Resolution attribute field when the Issues attribute field includes/contains "Code Violation" (when repairing issues identified in ObjectID's 1 & 3 above, I'd see the Code Violation Resolution field, when repairing ObjectID 2 above, I wouldn't).
Solved! Go to Solution.
Yes! It's literally the function Includes. But that assumes you're working with an array of values, which you could get with Split.
var issues = Split($feature.issues, ', ')
return Includes(issues, 'Corrosion')
If you don't want to deal with an array, there's also Find. This will return the position in the string in which the searched value shows up. In other words, any value greater than -1 means your searched string is in there somewhere.
Find('Corrosion', $feature.issues) > -1
Yes! It's literally the function Includes. But that assumes you're working with an array of values, which you could get with Split.
var issues = Split($feature.issues, ', ')
return Includes(issues, 'Corrosion')
If you don't want to deal with an array, there's also Find. This will return the position in the string in which the searched value shows up. In other words, any value greater than -1 means your searched string is in there somewhere.
Find('Corrosion', $feature.issues) > -1
Perfect, Thanks!
My fast scrolling went right past that section of data functions when I was searching for it!