Select to view content in your preferred language

Can Arcade create labels using data from related tables?

3463
5
Jump to solution
10-22-2020 09:17 AM
JeffDavis7
Regular Contributor

Hello,

Randy Burton was kind enough to assist me by providing some wonderful Python code for creating labels using data from related tables specific for use in ArcGIS Desktop.

I am hoping to take this a step further and provide my AGO users with same great labeling.  Randy suggested I post this question within the confines of AGO with the hope of obtaining some wise advice and direction.

Can someone please assist me in this venture?

Thank you.

Jeff

1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Hi Jeff Davis ,

For completeness I will add the answer also in this thread; It is not possible yo have access with Arcade in the label profile to related tables. You will need to add a field in the main featureset and fill it with the information of the related table(s) in order to show it as a label. The reason behind this is that wherever an Arcade expression needs to be executed for multiple features the functionality is limited (with the exceptions of the profiles field calculations and attribute rules) due to performance. 

Hopefully the Python code provided by Randy does not have a large impact on performance when moving around the map since it will need to executed for each label that will be shown in the map each time the map extent is changed. 

View solution in original post

0 Kudos
5 Replies
XanderBakker
Esri Esteemed Contributor

Hi Jeff Davis ,

For completeness I will add the answer also in this thread; It is not possible yo have access with Arcade in the label profile to related tables. You will need to add a field in the main featureset and fill it with the information of the related table(s) in order to show it as a label. The reason behind this is that wherever an Arcade expression needs to be executed for multiple features the functionality is limited (with the exceptions of the profiles field calculations and attribute rules) due to performance. 

Hopefully the Python code provided by Randy does not have a large impact on performance when moving around the map since it will need to executed for each label that will be shown in the map each time the map extent is changed. 

0 Kudos
JeffDavis7
Regular Contributor

Thank you, Xander.

Jeff

0 Kudos
WD1964
by
New Contributor

Hi Xander,

How do I go about displaying data from a related table as a label in Map Viewer (so not in ArcGIS Pro, nor in Map Viewer Classic)?

The idea is to show the names of all the occupants of various rooms as a label, so not as a pop-up. There is a one to many related table between a polygon feature representing the room and a table with names assigned to those different rooms). The purpose is to have a layout of a building that can be printed which contains all the people assigned to a room which can't be done when using pop-ups.

I realize there may be a performance issue but even if it takes a couple of minutes (or longer), it doesn't matter as in the end the information is displayed on the map and only serves to make a print.

0 Kudos
GrantHoward1
Occasional Contributor

Hi Xander,

you said this: "You will need to add a field in the main featureset and fill it with the information of the related table(s) in order to show it as a label."

How is that done?

Thanks,
Grant

0 Kudos
sofoo
by
Frequent Contributor

Found this "How To: Label a feature with multiple records in a joined or related table in ArcGIS Pro": 

https://support.esri.com/en/technical-article/000021133

Though this is Python and I don't understand how this logic would work.  First off how do you add a field to a query table...

0 Kudos