Select to view content in your preferred language

Arcade: Popups: FeatureSet by URL?

651
2
Jump to solution
10-12-2023 03:43 PM
Labels (1)
AlfredBaldenweck
MVP Regular Contributor

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?

0 Kudos
1 Solution

Accepted Solutions
ZachBodenner
MVP Regular Contributor

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.

 

View solution in original post

2 Replies
ZachBodenner
MVP Regular Contributor

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.

 

AlfredBaldenweck
MVP Regular Contributor

Ah, the layer item parameter was what I was missing.

I was expecting to use like, itemID/indexnumber or itemID&sublayer=indexnumber.

Thanks!

0 Kudos