Show Related Records in Pop-Up

18498
25
08-04-2016 10:42 AM
Status: Open
ChristopherStrong
New Contributor III

There have been other versions of this idea that have been flagged as "implemented", (https://community.esri.com/ideas/9541 and https://community.esri.com/ideas/11131 ) but the ability to show or format related records in the pop-up still does not exist.

It would be great to show a list of the related records in a feature's pop-up.  I'd like people to be able to view different contact information when clicking on a building, but the only way for this to work currently is by creating a long one-to-one join and publishing that as a service or by forcing users to open the table.  Both have implications with data design and user experience.

Both of the previous ideas where marked as implemented, but the 2016 update to ArcGIS Online only added related table functionality in the webmap's Details Page (which is not a user friendly way to interact with a webmap).  The 2016 update also allowed the ability to summarize related data (Configure pop-ups—ArcGIS Online Help | ArcGIS ), so one-to-many relationships with text display a feature count.  Again, while an improvement, this isn't terribly helpful for those wanting to view one or two details stored in a related table.

I understand it may be difficult to display potentially complex relationship information in a small pop-up, but I have faith in ESRI finding a way to make this better if they continue to work on it.

25 Comments
KevinLambeth1

This would be extremely helpful especially and much easier for our consumers to understand.

FernandoAlvarez

While it is nice to see the "see related records tab" it still not sufficient. Having related records would open the door for better deliverables on WAB. Its been 3 years since this was introduced, please add this feature to your plan.

JonathanSkloven-Gill

What is the point of GIS online (aka a relational database of data and geography), if you cannot access, display, design around said related data? ArcGIS Online has been around for a while now, this needs to become real

MichaelVolz

Unless I'm mistaken it seems like this Idea has been implemented, it's just that there are bugs associated with it especially with regards to showing related records in date order which would be important in inspection result type apps where you would revisit the site multiple times.

It seems like this thread is directly related to this issue as pop-ups in web app builder can display related records:

https://community.esri.com/thread/183860-is-sorting-related-records-in-web-app-builder-possible 

MichaelKelly3

This can be achieved using Arcade in the Popup - something like this does the trick:

var related_table = FeatureSetById($datastore, "1");
var filter_query = "parentglobalid = '" + $feature["globalid"] + "'";
var related_data_filtered = Filter(related_table, filter_query);
var related_data_filtered_count = Count(related_data_filtered);

var output = "";
if (related_data_filtered_count > 0) {
    output = "Total of " + related_data_filtered_count + " records";
    for (var relatead_data_row in related_data_filtered) {
        output += TextFormatting.NewLine + relatead_data_row.FieldName1 + " - " + relatead_data_row.FieldName2;
    }
} else {
    output = "No Related Records...";
}

return output;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

It outputs all of the related data which can be formatted as needed in the popup.

The outputs can be configured as appropriate. Some config changes necessary depending on your setup (in this case Global ID's are used for the relationship, and the fields being used are FieldName1 and FieldName2).

by Anonymous User

Hi Michael,

Using this expression, how would I be able to get related photos to show in the popup? I'm needing this functionality on several projects and it has been plaguing me. Is this even possible?

JanineLatham

Did you find a resolution for the related photos to show in a popup?

by Anonymous User

This is not possible with Arcade. However, it is possible to create Web Maps with attachments displayed in a popup when configured with the Map Viewer Beta - more info here. These new features are only compatible with applications written with the 4.x API.

If using 3.x, you have to run something like this which copies the Attachment URL to an attribute field so it can be viewed in the popup.

JaredPilbeam2

Michael,

So you're saying there is no way at all to view related photos in popups in either AGOL or Portal?

BeckyColwell-Ongenae

Michael,

When is support for viewing related record attachments in a web map/app pop-ups going to be implemented?  Is it on the roadmap? For what quarter? We need to know in order to plan for our projects and our agency. Please let this community know.  We've been asking on this thread since August of 2016.

Thanks,

Becky