Hi,
I'm following the tutorial here: https://community.esri.com/t5/attribute-rules-videos/update-multiple-fields-with-a-single-attribute/... , but can't seem to get this to work. Can anyone provide some insight??
//first get the intersecting grid
var gridNo = FeatureSetByName($datastore, "LAND_Grid", ["GRIDNO"], false);
var intersectingGrid = first(intersects(gridNo, $feature));
//return nothing if no intersection
if (intersectingGrid==null)
{return null};
return
{"result" :
{"attributes" :
{"FACILITYID" : "HYD-" + intersectingGrid.GRIDNO + "-" + NextSequenceValue("SeqHydrants"),
"GRIDNO" : gridNo}
}
}
Solved! Go to Solution.
You are attempting to populate the GRIDNO attribute with a FeatureSet (gridNo) instead of a value. Did you want an attribute from the original feature ($feature.yourField) in there?
You are attempting to populate the GRIDNO attribute with a FeatureSet (gridNo) instead of a value. Did you want an attribute from the original feature ($feature.yourField) in there?
Oh geez. Yeah....that is a problem. Always good to have a second set of eyes, but still something is not working even with this update. Those are for sure the correct field names.
return
{"result" :
{"attributes" :
{"FACILITYID" : "HYD-" + intersectingGrid.GRIDNO + "-" + NextSequenceValue("SeqHydrants"), "GRIDNO" : intersectingGrid.GRIDNO}}}
Have you checked whether you're getting back all the values you're expecting by using the Console? Make sure your sequenceName is correct.
Hi, yes, I have been building this step by step, so the names are correct.
I just did a re-type of the code and now it seems to be working. Maybe the order in which the fields are updated makes a difference?? Or the formatting of how I have things typed in?? Now it looks like this and seems to be working.
This is my first time working in Arcade. It seems very finicky.