I would like to create an Attribute Rule that intersects new points with a polygon that is hosted in our ENT portal.
FeatureSetByPortalitem function seems like it would be the best function, but it's not available in the Function list in the attribute rules. I'm new to this, so I'm asking anyway.
https://developers.arcgis.com/arcade/function-reference/portal_functions/#featuresetbyportalitem
My end goal is to publish a service that users with edit in Web App Builder. I'd like to populate as many attributes as possible automatically. Ease the burden on the program users. I currently have a domain set for county value, so there's a pick list, but it would be nice if I could calculate the county based on where the point is placed. I have an attribute rule that calculates email address, based on a domain list of people and this led me to think maybe I could do the same for county.
This made my idea look possible https://community.esri.com/t5/arcgis-pro-questions/how-to-add-values-from-polygon-to-points-which-are/td-p/1224509 but our county layer is hosted by our enterprise team - it isn't in my database.
https://community.esri.com/t5/arcgis-pro-questions/arcade-and-attribute-rules-featuresetbyname/td-p/1269597
Maybe FeatureSetById would work?
https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyid
But I cannot get it to find/load my table. I keep getting the error: Invalid expression. Table not found.
My code for that line looks like this
var polygons = FeatureSetById($datastore, `1`, ['Name'])
When I add that layer to my map it comes in as a single item in a group. Even though I've pulled it out of the group, could this be the issue? Is it seen as a feature collection?

I have checked the UniqueID box in the map properties, maybe I have the wrong ID?

I'd appreciate any help on this one. Thanks!