How to use the FeatureSetByRelationshipName Arcade function?

1073
5
Jump to solution
02-20-2020 10:45 AM
Highlighted
New Contributor II

Hello, 

I am trying to display related table information in my popups within my webmap. I have a layer and its associated related table within my layer list. I set up the Arcade function (FeatureSetByRelationshipName) within the custom attribute expression following the documentation online. When testing the function it seems to work as it should but when I click the popup within the map I get no information. How can I display my feature layer and related table information within the popup? 

Thanks! 

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Esteemed Contributor

Hi David Krady ,

If you look at the discussion here: How to get attribute with last date modified from related table using Arcade you will see an example of hao to extract a single value. 

The FeatureSetByRelationshipName returns a featureset and you can also loop through all related records to gather a list of data and present that in the pop-up as is described here: Using FeatureSetBy functions in Arcade to drill-down to other layers and tables (see the second and following expressions).

You can also apply statistical functions (sum, min, max, mean, etc) on the featureset.

View solution in original post

5 Replies
Highlighted
Esri Esteemed Contributor

Hi David Krady ,

The test result shows that you are receiving a featureset. A featureset however, cannot be visualized in a pop-up, that is why you won't see the information. You need to extract the relevant information from the featureset and return that as a (multiline) string or value.

What do you want to show in the pop-up?

Reply
0 Kudos
Highlighted
New Contributor II

Hi Xander Bakker,

I would like to show the fields for the layer as well as all of the fields for the related table within the popup. 

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi David Krady ,

Currently there is no support for returning a featureset, as you noticed. You will have to gather the information of each related feature and each field and this might make the expression a bit long and the visualization is limited since you cannot return HTML (yet).

Reply
0 Kudos
Highlighted
New Contributor II

Is it possible to extract a single field from the related table to show within the popup along with the layer attributes? Would you have an example on how to gather a related feature and field to display within the popup? 

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi David Krady ,

If you look at the discussion here: How to get attribute with last date modified from related table using Arcade you will see an example of hao to extract a single value. 

The FeatureSetByRelationshipName returns a featureset and you can also loop through all related records to gather a list of data and present that in the pop-up as is described here: Using FeatureSetBy functions in Arcade to drill-down to other layers and tables (see the second and following expressions).

You can also apply statistical functions (sum, min, max, mean, etc) on the featureset.

View solution in original post