How to Filter a List Widget Based on Another Layer

1379
10
01-30-2026 03:53 PM
Labels (1)
cjms
by
Regular Contributor

I have two feature hosted feature layers in AGOL and I want to use one layer to filter another layer in a List Widget.

Currently, I have a

  • Filter widget that filters layer 1, for example Tree types. This layer has the trees and the park name they're located in. e.g.
    Tree 1type 1park 1
    tree 2type 2park 1
    tree 3type 2park 2
  • A list widget with the second layer that is just parks and locations.
  • A map widget with both layers

If I filter for a tree type in my filter, it will filter the map with Message Actions. On the map, I thought i could use actions Actions to (trigger data --> action data base on Park name) to filter the list. However, the only available message action on the Map is Record Selection Changes, so then I have to click a tree on the map in order to filter my Park list.

I would prefer that as soon as a tree type is filtered for, all parks without that tree are filtered out of the List widget. However, the Filter widget doesn't have any filter changes triggers to filter the list.

Am I missing something simple? This seems like a straight forward thing to do.

0 Kudos
10 Replies
ToddW_stl
Esri Contributor

if your trigger is "Record selection changes", do you have a Framework action to "Filter data records"?  

I have 2 lists in my app - the first list (could be a list of unique "Tree types" for you) filters down my map and a second list (could be a list of parks that have that tree type).

  • 1st list:
    • Action tab > Message action > Record selection changes trigger > actions: Zoom to (on the map) and Filter data records (on the Framework)
    • when i click a row in the first list, the 2nd list filters and the map zooms to the building
  • 2nd list:
    • Action tab > Message action > Record selection changes trigger > actions: Zoom to (on the map) and Filter (on the map)
    • when i click one of the filtered results in the second list, the map zooms and filters to that specific point

I can't show the map data, but attached a gif of the list behavior below.

0 Kudos
cjms
by
Regular Contributor

Thanks for response and GIF. A couple of follow-up questions:

  1. How would I get a unique list of types? Do I need a third layer that is just a table of tree types?
  2. How do you set the actions of one list to interact with the other? My list only shows the Map widget as a selectable target
    cjms_0-1769847892491.png

     

 

0 Kudos
ToddW_stl
Esri Contributor

if it matters - I'm using the version of ExperienceBuilder that comes with ArcGIS Enterprise 11.5 - please let me know what tech/version you're on!

I'm not sure why you're only seeing Map...  what do you see when you click List > Action tab > Message Action sub-tab > Add a trigger button > Record selection changes button?  This is where I see "Framework".  Essentially (as I understand it at least), when I select a record in the list (trigger - record selection changes), I want to apply an action that affects the entire app or any/all data used everywhere in the app (framework), and I want to Filter (action) that data by the configured field and attribute that I'm displaying in my first list.

ToddW_stl_5-1769951100375.png

In my case, not every building in my data has the a feature of interest, so I had to create a data expression and manually select the buildings I wanted to show in the first list.

ToddW_stl_0-1769950273208.pngToddW_stl_1-1769950298736.png

ToddW_stl_2-1769950360972.png

ToddW_stl_3-1769950454748.png

ToddW_stl_4-1769950484940.png

 

0 Kudos
cjms
by
Regular Contributor

I'm using ArcGIS Online, so whatever version that one is at.

Ah, I see if I use the Record Selection Changes, I have a data option. I was using the using the trigger Data Filtering Changes. I'm guessing the difference in AGOL and Enterprise is why this says Data instead of Framework.

cjms_0-1770078033066.png

I guess now the problem is that when link my List 2 to Trees, it gives a row for every tree, whereas I want a distinct list of Tree types from my tree layer. You mentioned data view, but my only options are filtering and sorting; I don't see any way to do a SELECT DISTINCT tree_type.

cjms_1-1770078233980.png

I could create a Hosted Table that is just tree types, but then that table wouldn't be related to any parks like the current Trees layer is that list the Tree and what park it is in.

 

0 Kudos
ToddW_stl
Esri Contributor

Ah - yes that might be your best bet.  I don't think the table would need to be related to parks, as you would associate the tree type from the table with the tree type on the tree/parks layers (see my last screenshot that shows "Conditions: Trigger / action connection" where I'm using the Facilities layer FacilityID field that is associated to the Restrooms layer FacilityID field.

If you're not tied to using ExperienceBuilder, this thread mentions using UNIQUE sql in a Dashboard list - Unique values in a List widget.

0 Kudos
cjms
by
Regular Contributor

Thanks for the link! The Unique in SQL works great to get a distinct list; however I'm still left with the problem of having the filter cascade from one list to another since the only available target for Data Filter Change is the map (pan, zoom, flash). 

cjms_0-1770273366467.png

Using Record Selection Change DOES work to filter the list, so I guess that is kind of what I want? That's a bit inconvenient though that I would need to use the Filter first, then select an item from the first list to filter the second list. Hope that makes sense.

Seems like if the Data Filter Changes trigger could target something more than just the map, that would solve my problem.

For now, my workaround has been to add another field that I just concatenate all the types into (type1;type2) then my filter is Contains text. Luckily, my concatenated list is less than 255 characters.

 

0 Kudos
ToddW_stl
Esri Contributor

I think I figured out a pretty good solution in ArcGIS Online with the following assumptions after re-reading some of this thread more slowly:

  • you have a point layer of Trees with attributes that represent "tree name", "tree type/species", and "park where the tree lives"
  • you have a polygon layer of Parks where the only important info is the polygon geometry (park location) and an attribute like "park name"
  • the Trees layer "park where the tree lives" attribute strings exactly match a Park layer polygon with "park name" attribute
  • Desired workflow:
    • filter Trees by tree type/species
    • use filter above to filter Parks to only parks that contain that tree type
    • see a list of the filtered Parks
    • optionally pan/zoom to a specific resulting park location on the map

I achieved this in ExperienceBuilder (see demo gif) by:

  • add a web map which contained my hosted tree points and park polygons layers
  • add a Filter widget for tree type
    • set to use custom filter on tree layer (default)
  • add a Select widget for spatial filtering
    • spatial selection - select by tree layer (default)
    • action
      • trigger: record selection changes
      • action: filter data records
        • trigger data: trees
        • action data: parks (default)
        • conditions: park name/park name
  • add a List widget to show resulting parks
    • set to use parks data (selected features)
    • no data message: "List of Selected Parks"
  • add a Search widget to search/find/pan/zoom to a specific park
    • interact with map
    • add parks as search source
      • search options: park name field
      • hint: Find a park

filter_select_populate_list.gif

I hope I didn't miss anything, but let me know if you have any issues/questions!

Happy mapping and apping!

0 Kudos
Wei_Wang
Esri Contributor

Hi, @cjms 

You can trigger List widget filtering by configuring the Action settings within the Filter widget. Here are the steps:

  1. Go to the Action tab and select: Add a Trigger->Data filtering changes-> Filter data records.
  2. Set Trigger data to Layer 1 (Filter widget) and Action data to Layer 2 (List widget).
  3. Set Trigger / action connection: Match the identical fields from both layers (e.g., the "park" field) as the Trigger field and Action field.
0 Kudos
bczerniak
New Contributor

Hi,
I’m experiencing the same issue. I’m using ArcGIS Experience Builder 11.5 (Enterprise), and unfortunately I cannot find the settings you described.

You wrote:
“Go to the Action tab and select: Add a Trigger → Data filtering changes → Filter data records.”
→ However, I don’t have the option “Filter data records”.
The only options available for me are the Map Widgets, where I can trigger pan or zoom actions.

I would really appreciate any help!

Thanks a lot.

0 Kudos