I spoke with @HusseinNasser2 at the conference about an issue with my Arcade expression. Using his sample, I'm trying to recreate my rule, starting with a simple intersect. Ultimately, this rule will include intersections with multiple layers, so I'm modifying the sample to use a results dictionary.
I'm running into a problem when I try to save the attribute rule. It validates fine when I'm in the Expression editor, and console messages show a valid result. However, when I click 'Save', I'm presented with the following error:
ERROR 002717: Invalid Arcade expression, Arcade error: Unexpected null, Script line: 8
var fs = FeatureSetByName($datastore,"City_Limits",["TOWN"],false);
var intFs = Intersects(fs, Geometry($feature));
var cityLimit = First(intFs)
return {
'result':{
'attributes':{
'MUNICIPALITY':cityLimit.TOWN
}
}
}
As I said, the Expression validates normally in the Editor:
and the console message >> console(cityLimit.TOWN) yields:
If I print the entire results dictionary to the console, I get this:
{"result":{"attributes":{"MUNICIPALITY":"Omaha"}}}
Any ideas why I'm having a problem here?
Solved! Go to Solution.
How embarrassing for me. That was the problem. 😐
Thanks Mike