Can feature service be used as parameter in Attribute rule?

60
1
Jump to solution
01-16-2020 06:23 AM
Highlighted
MVP Frequent Contributor

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;
Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Esteemed Contributor

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 

View solution in original post

1 Reply
Highlighted
Esri Esteemed Contributor

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 

View solution in original post