Select to view content in your preferred language

How Can I Propagate Filters from a Parent Layer to a Related Table in ArcGIS Online?

50
4
4 hours ago
Labels (3)
YuriWalsh
New Contributor

I'm currently working with related datasets in ArcGIS Online, where I have a parent feature layer (e.g., "Sites") and a related child table (e.g., "Inspections"). The parent records contain important attributes — for example, a field that marks a site as "deprecated" — but this attribute does not exist in the child table.

In my workflow, I need to filter out inspections (child records) that belong to deprecated sites (parent records), but I'm running into limitations with how ArcGIS Online handles relationships and filtering across layers.

So far, I’ve noticed:

  • The relationship is recognized in the attribute table and in pop-ups.

  • However, filters applied to the parent layer do not automatically filter the related child table.

  • There doesn’t appear to be native support for propagating filters from the parent to the child in  dashboards.

Has anyone found a workaround or best practice for this?

  • Is there a way to simulate filter propagation across related layers in ArcGIS Dashboards?

  • Can this be handled with views or Arcade expressions?

  • Or is this something better handled in external tools like Power BI, where relationships and filtering are more flexible?

I’m trying to avoid duplicating attributes in the child table if possible.

0 Kudos
4 Replies
AustinAverill
Frequent Contributor

Is this a permanent filter that you are wanting to query the data with or something that you want to be able to toggle on and off?

0 Kudos
YuriWalsh
New Contributor

This would be a permanent definition query type filter made on the parent layer that would also filter the related records.

0 Kudos
AustinAverill
Frequent Contributor

There is no specific way to link relational data through the GUI that I am aware of. But since this will be a static view you are wanting to produce, you could certainly create these data sets using Arcade data expressions. Assuming you have your parent layer already loaded into the dashboard using the GUI filter option, you would just need to create the arcade data expression to retrieve your child records.

A script for this would look something like the following:

var _portal = Portal("https://myorg.maps.arcgis.com");
var itemId_ = "1b98f366008f4e6024";

var parentLayer = FeatureSetByPortalItem(_portal, itemId_, 0);
var childLayer = FeatureSetByPortalItem(_portal, itemId_, 1);

//define parent and child relational fields
var parentField = 'GlobalID'
var childField = 'meterGlobal'


//Get featureset of only parent records that meet filter criteria
var filtField = 'Meter_Designation';
var filtValue = 'Flow Meter';

var parent_interest = Filter(parentLayer, `${filtField} = '${filtValue}'`);


//define the structure of the featureset to add your matching child records to
var flds = Schema(childLayer)['fields']
var geoType = Schema(childLayer)['geometryType']
var geoRef = {'wkid' : 4236}//change to appropriate reference
var feats = []

//loop through parent layer to filter child layer
for(var f in parent_interest){
  var parentId = f[parentField]
  var temp_feats = filter(childLayer, `${childField} = @parentId`)
  //loop through filtered child layer and append each feature to feats array
  for(var c in temp_feats){
    push(feats, c)
  }
}

//define featureset json
var defi = {
  'fields' : flds,
  'spatialReference' : geoRef,
  'features' : feats
}

//call FeatureSet and return
var fs = FeatureSet(defi)
return fs

The result (bottom table) is a table of records for my child layer that match the filtered records from my top table, assuming I filtered the parent table the same way in the Arcade Expression as I did in the Dashboard GUI.

0 Kudos
RPGIS
by MVP Regular Contributor
MVP Regular Contributor

There is a way to do this and there are two ways, at least to my knowledge, that can work to achieve this.

  1. Using the List method:
    1. Use @AustinAverill suggestion to create a new dataset as a data expression.
    2. Once the data expression is created, add the list to the dashboard.
    3. Once the look and feel of the list, set your layer action to filter that specific list using that common attribute
  2. Using the Category Selector in the header:
    1. Step 1:
      1. Add the header to your dashboard
      2. Once added, select configure (upper left hand corner of the header) and select the category selector
      3. In the category configuration, select grouped values.
      4. Select the parent table
      5. Select the field that has the relational information in both the parent and child table(s)
    2. Step 2:
      1. After completing step one, follow the same steps as Step 1 but for the child table
      2. Apply a filter to the child table based on your specific criteria
      3. Set the field to which value you want the layer to be filtered/selected
    3. Step 3: 
      1. Once the category selector is configured, go back to the first category
      2. In the Actions tab select the filter option
      3. Set to filter the child category selector.
    4. Step 4 (Optional):
      1. Configure the child category select Action to filter other tables(s) if applicable.

Note: For the category selectors, it is best to name each item in the general tab under selector options, so you know which item to filter.

RPGIS_0-1760554482697.png

 

0 Kudos