HOW TO
When configuring pop-ups of a layer in ArcGIS Online Map Viewer Classic, Configure Attributes provides the option to choose fields from a related table to be displayed in the pop-up. Related fields include {relationships} in the field name. In a one-to-many relationship, displaying related attributes of a string field in the pop-up shows the count instead of the text values. Refer to ArcGIS Online: Show related data for more information.
The image below shows a pop-up displaying the count for the string field (Land_Use) from a related table, and the original attributes of the field in the attribute table.
Note: This limitation only occurs in ArcGIS Online Map Viewer Classic.This article describes the steps to display the attributes from a related table string field in the ArcGIS Online Map Viewer Classic pop-up using Arcade and the FeatureSetByName expression.
In ArcGIS Online, open the web map or hosted feature layer in Map Viewer Classic, and configure the pop-up to display the related table string field using the attribute expression provided below. Refer to ArcGIS Online: Use attribute expressions for steps to do this. Replace Related Table Name with the name of the related table, Field Name with the string field name to be displayed in the pop-up, and Common Field Name with the name of the field that the relate is based on.
var tbl=FeatureSetByName($datastore,"Related Table Name",['Field Name']) var fc=$feature.Common Field Name var sql = 'Common Field Name=@fc' var relatedData=filter(tbl,sql) var cnt=count(relatedData) console(cnt+' Records') var result='' if(cnt>0){ for (var r in relatedData){ var x =r.Field Name result += text(x) console(x) } } return result
The image below shows the configured expressions to display the string field (Land_Use) from the related table (Land_Type). The common field name in this example is OBJECTID.
The image below shows the pop-up displaying text values from the string field.
Get help from ArcGIS experts
Download the Esri Support App