With the following, I get an error. Is it even possible to use a feature service as an input in an attribute rule? What I'm trying to do is calculate a value on insert/update based on the intersecting value from the feature service.
var fsPolyBoundary = FeatureSetByName($datastore, "https://services1.arcgis.com/fBc8EJBxQRMcHlei/arcgis/rest/services/NABAT_CONUS_10x10_KM_GRID_CELLS/FeatureServer/0", ["GRTS_ID "], true)
var fsPoly = Intersects(fsPolyBoundary, Geometry($feature))
var loc = First (fsPoly)
var name = ""
if (loc == null)
return {"errorMessage": "Point must be created in a Grid."}
else
name = loc.LOC_NAME
return name + " - " + $feature.LOC_NAME;
Solved! Go to Solution.
Hi Thomas Colson ,
The FeatureSetByName will requiere you to provide the exact name of the layer in the current data store and not the URL.
Also have a look at this blog: Advanced Attribute Rules – Editing features on another class with attribute rules
Hi Thomas Colson ,
The FeatureSetByName will requiere you to provide the exact name of the layer in the current data store and not the URL.
Also have a look at this blog: Advanced Attribute Rules – Editing features on another class with attribute rules