Dynamically retrieve webmap ID in Popup

04-02-2020 06:11 AM
New Contributor

Hi all,

Currently we're using a Arcade expression to make a custom URL which we place in a Pop-up. This works fine, the only issue is that we use the same expression for the same layer in multiple web maps. The only thing we have to change manually is the web map item id. Ideally, the webmap id is retrieved dynamically. This would allow us to use the Arcade expression in multiple webmaps without changing it at all. In other words: is it possible to tell a popup which webmap id to use, based on the web map in which the pop up is configured? Or should this be an Idea?

We're using the following expression: 
Var collector = "Arcgis-collector://?itemID="
Var webmapID = "<WebmapID>"
Var ServiceUrl = "<layerURL>
Var "field1= "Projectkenmerk"
Var value1= $feature.projectkenmerk
Var field2= "Meldingnummer"
Var value2= $feature.OBJECTID
var url = collector + webmapID + "&featureSourceURL=" + kaartlaagServiceUrl +"&featureAttributes=%7B"
url = url + field1 + value1 + field2 + value2
return url

0 Kudos
1 Reply
Esri Esteemed Contributor

Hi Werkwijze(R) beheerder ,

Arcade has no knowledge of the web map it is being executed in. However, you could create a dictionary with web map ID's and if there is something in the map that can be used to determine which web map ID to use, this would be feasible. Can you explain a bit more about how many web maps you are using and why you need to use different web maps?

0 Kudos