Hello, I have some Census tract data as a hosted feature layer in AGOL: Layer1. I have another set of Census tract data as a hosted feature layer: Layer2. Both are using the same Census tract geography and both have a common Census tract GEOID field. I would like to use Arcade to populate fields from Layer2 into Layer1 so they can be used in a popup and a chart in Layer1 based on the common GEOID field. I would like to use Arcade to and do not not want the join the data.
Thanks
How familiar with arcade are you?
Folks ask this question quite often and there are a handful of Esri blogs that detail the steps.
Using the Filter function will get you what you need. This blog will basically walk you through your exact scenario step by step.
Pump Up Your Pop-ups With Arcade FeatureSets and the Living Atlas (esri.com)
And if you need an example for Map Viewer and not Map Viewer Classic: https://learn.arcgis.com/en/projects/access-attributes-from-another-layer-with-arcade/#:~:text=Obtai...
Basic Steps in the Pop Up Editor Attribute Expression Arcade Editor Window:
1. Set a variable for the GEOID in the feature you are working with (var step1 = $feature.nameofGEOIDfield)
2. Set a variable to pull in the other layer in your map using the function: var step2= FeatureSetbyName($map, layernameinwebmap, ['whateverfieldsyouwant', 'fromthatlayer', 'separatedbyacoma'], false)
3. Set up a variable for the filter that pulls the GEOID from step 1 and compares it to feature set in step 2. var step3 = Filter(step2, 'nameofGEOIDfieldfromstep2 = @step1')
4. Set up a variable that pulls out the first result from there (could combine "var step3 = First(Filter(....))
5. Return the specific attribute from that variable using "return step4variable.nameofattribute"
The end of this blog article also includes examples showing how to add information from other layers in your map as well as layers from other destinations, such as Living Atlas
https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/pop-ups-arcade-essentials/
This map is the example in that blog: https://www.arcgis.com/apps/mapviewer/index.html?webmap=bcecad5bc4a5456bada1cd5e230bbf7f
Click a peak and then examine the Arcade expression for that layer to see how the feature is buffered to search for additional information from Living Atlas layers not included in the map.