Select to view content in your preferred language

Get related objects in Arcade

9865
12
06-19-2017 03:06 PM
TheodoreRakel
Frequent Contributor

Is there a way in the Arcade Labeling profile to access the objects related to a feature?

Tags (2)
0 Kudos
12 Replies
JeffreyOwen1
Occasional Contributor

I came here to ask this exact question. Let me know if you figure anything out. I want to label or symbolize based on the number of related features. I found you can access related feature information in the pop-up configuration (ArcGIS Online), but not the labeling expression (or at least what I could figure out.)

0 Kudos
TheodoreRakel
Frequent Contributor

Can you share how you were able to access related feature information in the pop-up configuration in ArcGIS Online?  I don't see how to do that.  Thanks.

0 Kudos
JeffreyOwen1
Occasional Contributor

This might not be what you are looking for but it worked somewhat for me since I only want the count of related features.

Go into the Configure pop-up menu. There you will have the option all the way at the bottom to "Show related data" which will put a hyperlink in the popup that will open the attribute table of the related features. But also you can click the "Configure Attributes" link.

Then you should see the related table attributes but it only appears to allow you to display a count (which again is what I needed).

JeffreyOwen1
Occasional Contributor

And also I forgot to mention that I also see related layer/table info available in the Chart configuration at the bottom of that first screenshot.

0 Kudos
LindsyHales_Bentley
Occasional Contributor

I came here with the same question - is there any update on how to do this?

0 Kudos
XanderBakker
Esri Esteemed Contributor

Yes there is an update. In the december update of ArcGIS Online, an couple of new functions were introduced (FeatureSetBy*) which allow accessing related content (being present in the map or in the same datastore). A couple of resources that you might be interested in are:

The downside is that these functions are not available in the label expression nor in defining the symbology. However, you could create a new field and do the field calculation to access the related content and define the text for the label and label the layer based on that new field. This is not a good option if your data is very dynamic and changes a lot (since it would require you to recalculate the field). 

LindsyHales_Bentley
Occasional Contributor

Thanks Xander.  That is some great stuff.  

What if I only want to show a pipeline and it's related table in the popup?

0 Kudos
XanderBakker
Esri Esteemed Contributor

If the related table is published using a relationshipclass, this will be standard functionality that does not requiere any Arcade expression. 

The FeatureSetBy* functions in Arcade allow you to create these relations using filters connecting to a table or analyze a spatial relationship between two or more hosted feature layers.

0 Kudos
LindsyHales_Bentley
Occasional Contributor

I did try publishing out a fc and table using a relationshipclass, however the pop-up still requires you to click "show related records," which opens a table.  I am hoping to be able to show all (fc attributes and related record(s)) in a single pop-up (for the not-so-tech-savy).

0 Kudos