Select to view content in your preferred language

Filter map layer and related tables

100
2
Jump to solution
Monday
Labels (1)
JustinWolff
Regular Contributor

We have a hosted feature layer in AGO containing one (1) polygon feature class, and three (3) tables with multiple relationships:

Tracts (Polygon) -> 1:Many -> Tract Notes (Table), relationship fields OBJECTID -> TractGUID

Project (Table) -> 1:Many -> ProjectNotes (Table), relationship fields OBJECTID -> ProjectGUID

Project (Table) -> 1:Many -> Tracts (Polygon), relationship fields OBJECTID -> ProjectGUID

So one Tract may have multiple TractNotes records, one Project may have multiple ProjectNotes records, and one Project may have multiple Tract features.

In Experience Builder, I would like to filter the Project table on the 'Project Name' field, and have it also work against the Tracts polygons in the map.  Ideall, the Edit widgets configured to add records to Tracts, TractNotes and ProjectNotes would default the ProjectGUID values in Tracts and ProjectNotes.  We are currently using a Survey widget to add polygon features, pulling geometry and some attributes from another map layer, and an Edit widget to add records to the TractNotes and ProjectNotes tables.  I'm hung up on the initial Project filter - how do I configure a Filter to work against related records?  Based on what I'm finding elsewhere in Community this may not be an option?  Thanks

 

0 Kudos
1 Solution

Accepted Solutions
Laura
by MVP Regular Contributor
MVP Regular Contributor

I ran into a similar issue. I have a layer with two related tables, and I needed to filter based on the related records. To work around it, I created joined view layers for each table so they would have a spatial reference. This allowed me to zoom to and filter the data.

In my case, I used the Query widget, but the approach should be similar. I set up actions within the framework to Filter Data Records and Select Data Records, using the view layer as the trigger and the original polygon layer as the action target. That way, it would zoom to the correct feature and display the custom popup I configured on the polygon layer.

View solution in original post

0 Kudos
2 Replies
Laura
by MVP Regular Contributor
MVP Regular Contributor

I ran into a similar issue. I have a layer with two related tables, and I needed to filter based on the related records. To work around it, I created joined view layers for each table so they would have a spatial reference. This allowed me to zoom to and filter the data.

In my case, I used the Query widget, but the approach should be similar. I set up actions within the framework to Filter Data Records and Select Data Records, using the view layer as the trigger and the original polygon layer as the action target. That way, it would zoom to the correct feature and display the custom popup I configured on the polygon layer.

0 Kudos
JustinWolff
Regular Contributor

Thank you, Laura, I think that's the route I'm going to have to go.  

0 Kudos