Working on a popup. I'd like it to reference an item in a portal. Unfortunately, the item I want is a map image service, so while the service itself has an item id, the layers within do not. I can add the individual layers directly to my map using the REST URL, but I can't access them with Arcade, as best I can tell.
Is it possible to access a feature service using its URL, rather than portal id?
Solved! Go to Solution.
You're very much on the right track. The function you want is FeaturesetByPortalItem, and then make sure to feed in the layer id parameter.
https://developers.arcgis.com/arcade/function-reference/portal_functions/#featuresetbyportalitem
So for example, if you had a feature/map layer that had Trees, Playgrounds, and Parks, and their layer ids were, respectively, [0], [1], and [2], and you wanted to access Parks, your function would read:
var parks = FeatureSetByPortalItem( Portal('<portal url>'), '<item ID>', 2);
edit: correct name of function.
You're very much on the right track. The function you want is FeaturesetByPortalItem, and then make sure to feed in the layer id parameter.
https://developers.arcgis.com/arcade/function-reference/portal_functions/#featuresetbyportalitem
So for example, if you had a feature/map layer that had Trees, Playgrounds, and Parks, and their layer ids were, respectively, [0], [1], and [2], and you wanted to access Parks, your function would read:
var parks = FeatureSetByPortalItem( Portal('<portal url>'), '<item ID>', 2);
edit: correct name of function.
Ah, the layer item parameter was what I was missing.
I was expecting to use like, itemID/indexnumber or itemID&sublayer=indexnumber.
Thanks!