AnsweredAssumed Answered

Can feature service be used as parameter in Attribute rule?

Question asked by tpcolson Champion on Jan 16, 2020
Latest reply on Jan 16, 2020 by xander_bakker

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;

Outcomes