I am trying to create a customised pop-up in AGOL for a web layer I have uploaded that has a related table (text only).
Polygon table structure is:
GlobalID (GUID)
Area (shape_area)
Length (shape_length)
Related table structure
GID1 (GUID) - this is the related key back to the parent polygon table
Type (text)
Number (short)
Phase (text)
Right now I can click on "show related records" in the pop-up, but ideally I would like this information to be displayed in the pop-up and not in a separate table below the map.
I tried doing some simple arcade programming and got the expression result to work using this:
FeatureSetByRelationshipName($feature,"native_plantin_rel_table",["Type","Number","Phase"])
But when I implement this in the popup, it does not work and only get "No information available" message in the popup
Any ideas?
Thanks in advance!
Solved! Go to Solution.
Hi Jeff Van Etten ,
When you use an expression like you did, this will return a featureset, which will show when you test the expression in the editor, but this will not show in the pop-up. You will have to loop through the records in the featureset and define how to present them in the pop-up.
You can find some examples here: https://community.esri.com/message/900835-show-all-related-or-joined-attributes-in-a-popup
Most commonly the Web Maps you create are for use in Collector to get what you want.
You will need to make a Web App using Web App Builder and related tables will show up in a pop up.
Robert, this is not for collector. Thanks.
Hi Jeff Van Etten ,
When you use an expression like you did, this will return a featureset, which will show when you test the expression in the editor, but this will not show in the pop-up. You will have to loop through the records in the featureset and define how to present them in the pop-up.
You can find some examples here: https://community.esri.com/message/900835-show-all-related-or-joined-attributes-in-a-popup
Xander
Have looked at the link and I can test the arcade script and it works, but when I try to use this, nothing is coming up. Here is my arcade script.
var aquatic_id = $feature["GlobalID"];
var aquatic_tbl = FeatureSetByName($map,"aquatic table");
var sql = "GID1 = '" + aquatic_id + "'";
var aquatics = Filter(aquatic_tbl, sql);
var cnt = Count(aquatics);
var result = "Species: ";
if (cnt > 0) {
for (var aquatic in aquatics) {
result += TextFormatting.NewLine + " - " + aquatic.Type + " (" + aquatic.Number + ")";
}
} else {
result += TextFormatting.NewLine + " - No species present";
}
return result;
Just closed the map viewer and opened this back up and it now works! Fantastic!