Hi all! I am trying to create a custom pop up in Map Viewer with the Arcade content element that will return related records from another layer (there is no relationship class, I am just using a filter statement). My challenge is that the relationship is 1:M and I would like to have the pop up display data from more than one record as a field list (i.e. return type "fields", as opposed to text or a pop up string).
Is it possible to return a field list type for more than one record in an arcade element? Here's the basic code I am using that just gets the first related record, how can I modify it to return all related records? Thanks in advance for your ideas!
This code is modified from: https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/part-2-introducing-arcade-pop-up-con...
Solved! Go to Solution.
Not easily, no. An Arcade popup element will be limited to a single field list. You can put as many related records into your field list as you want, but they won't be separated in any way, so they'll all sort of bleed together.
The other issue is that your attributes object needs unique keys. As you loop through your related records, you would need a new field name for each record, and while that's doable, it's not going to look great.
Since the text output will honor HTML tags, you could build a table with HTML and assign the appropriate style / class tags to get the final result to render just like a Field List. This would give you the flexibility to do multiple records in a clear way, too.
Not easily, no. An Arcade popup element will be limited to a single field list. You can put as many related records into your field list as you want, but they won't be separated in any way, so they'll all sort of bleed together.
The other issue is that your attributes object needs unique keys. As you loop through your related records, you would need a new field name for each record, and while that's doable, it's not going to look great.
Since the text output will honor HTML tags, you could build a table with HTML and assign the appropriate style / class tags to get the final result to render just like a Field List. This would give you the flexibility to do multiple records in a clear way, too.