1

I have a polygon feature class (BIA tribal boundaries) with three relationship classes set up to relate to three separate tables, each with a 1:M cardinality from the feature class to the table. I want to configure the popup for the polygon feature class in ArcGIS Pro (not AGOL) to show the related data. I can do this for statistical data, like counts of the records in each table, but what I want to show is a list of values from selected string type fields in the related tables.

For example: I have selected the Ute Mountain Ute tribe, and the related records in each table are selected automatically. I configured the popup to show a count of the records selected in each table and also the string values I want to "list". However, the record count shows multiple records, but the string value only shows one value, selected at random from the table(s). For instance, under the "BIA Federally Recognized Tribe Table" heading in the popup, the record count shows 3, but only UT is listed as a state (should also be CO and NM). enter image description here

My question is this: how do I configure the popup in ArcGIS Pro to list the string values from multiple records in a related table?

Using ArcGIS Pro 2.8.3.

asked Dec 30, 2021 at 23:45

1 Answer 1

2

An Arcade expression can be used in the configure pop-ups window. Using the "FeatureSetByRelationshipName" data function, which Returns the related records for a given feature as a FeatureSet. A possible expression is as follows:

var relate_fld = "FedRegistryName";
var rc_name = "BIA_LAR_7WesternStates_bia_entity_link_table";
var results = FeatureSetByRelationshipName($feature, rc_name, [relate_fld], false);
var output = "";
for(var rec in results) {
 output += "|" + rec[relate_fld];
}
output = Trim(output);
output = Replace(output, "|", ";");
return Replace(output, "|", "", false);

enter image description here

The last three lines attempt to clean up the delimiter, which is still not perfect (puts a semicolon before the list of values).

EDIT:

The above Arcade expression will not work in ArcGIS Online. Here is the comparable expression for use in AGOL popups using the FeatureSetByName data function (currently, related records only work in AGOL Map Viewer Classic):

var tbl = FeatureSetByName($datastore,"bia_entity_link_table",['FedRegistryName'])
var fc = $feature.LARID
var sql = 'LARID=@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.FedRegistryName
 result += '|' + text(x)
 console(x)
 }
}
result = Trim(result);
result = Replace(result,'|',';');
return cnt + ' tribe(s) in this reservation: ' + TextFormatting.NewLine + Replace(result, '|','',false);

enter image description here

answered Jan 2, 2022 at 21:47

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.