Select to view content in your preferred language

Can Arcade pop-up expressions use a map service not in the web map?

1391
2
Jump to solution
01-27-2023 11:47 AM
Labels (1)
JeannetteByrd
Emerging Contributor

I was wondering if it's possible to create a pop-up Arcade expression that uses the Intersects function for a feature service not in the current web map in ArcGIS Online? If so, how is that feature service accessed? I would think it would be something to do with FeatureSetById.....Any help would be appreciated!!

0 Kudos
2 Solutions

Accepted Solutions
Teresa_Blader
Frequent Contributor

You can use FeatureSetByID or FeatureSetByName or FeatureSetByPortalItem 

The links I include all have Esri's examples. I'd recommend FeatureSetByPortalItem, which calls the item ID in the item url. The others probably have to use $datastore... not as familiar with that way. 

I usually set it to a variable first, then just include the variable in your intersect script. The tip is in the FeatureSet call, make sure to enter the layer number from the item url and to only enter in the attributes you'd like to display in that specific expression in the brackets []. [*] notates pulling all the variables. If you're trying to come up with a "new" attribute, build the expression under Attribute Expression in the popup builder. If you're looking to do a custom chart or something, use Arcade under the options of content types to add in the popup. 

Teresa Blader
Olmsted County GIS Specialist

View solution in original post

BernSzukalski
Esri Frequent Contributor

This blog article covers using Arcade to add information from Living Atlas layers not in your map. Similar Arcade can be applied for layers from other organizations.

https://www.esri.com/arcgis-blog/products/arcgis-living-atlas/decision-support/enhance-your-pop-ups-...

 

View solution in original post

2 Replies
Teresa_Blader
Frequent Contributor

You can use FeatureSetByID or FeatureSetByName or FeatureSetByPortalItem 

The links I include all have Esri's examples. I'd recommend FeatureSetByPortalItem, which calls the item ID in the item url. The others probably have to use $datastore... not as familiar with that way. 

I usually set it to a variable first, then just include the variable in your intersect script. The tip is in the FeatureSet call, make sure to enter the layer number from the item url and to only enter in the attributes you'd like to display in that specific expression in the brackets []. [*] notates pulling all the variables. If you're trying to come up with a "new" attribute, build the expression under Attribute Expression in the popup builder. If you're looking to do a custom chart or something, use Arcade under the options of content types to add in the popup. 

Teresa Blader
Olmsted County GIS Specialist
BernSzukalski
Esri Frequent Contributor

This blog article covers using Arcade to add information from Living Atlas layers not in your map. Similar Arcade can be applied for layers from other organizations.

https://www.esri.com/arcgis-blog/products/arcgis-living-atlas/decision-support/enhance-your-pop-ups-...