Select to view content in your preferred language

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

485
11
10-15-2025 08:32 AM
Labels (3)
YuriWalsh
Emerging 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
11 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
Emerging 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
YuriWalsh
Emerging Contributor

I tried to use your example arcade, but keep running into the "unable to execute arcade script" error. Below is the arcade I have. I ran it through copilot to identify any errors, but it was not super helpful. I am not too sure why I am running into an error, maybe you can help... 😁

// Connect to Portal
var portalAccess = Portal('https://myorg.maps.arcgis.com/');

// Parent Table: DSpace Aux Data
var PARENT_DATA = FeatureSetByPortalItem(
    portalAccess,
    'a7f2c1e89b6d43fa2c90de',
    0,
    [
        'REGION',
        'OBJECTID',
        'DELETERECORD',
		'DELETERECORD_REASON',
        'STRUCTURETYPE',
        'AREA',
        'INSPECTIONSTATUS',
        'GLOBALID',
        'INSPECTIONDATE'
        
    ],
    false
);

// Filter parent records
var parent_sql = "DELETERECORD_REASON IS NULL";
var parent_interest = Filter(PARENT_DATA,parent_sql);

// Child Table: Inspection Data
var CHILD_DATA = FeatureSetByPortalItem(
    portalAccess,
    '8e11a3e46f29b6e9',
    1,
    [
        'REGION',
        'PARENTGUID',
        'OBJECTID',
        'DELETERECORD',
        'STRUCTURETYPE',
        'AREA',
        'DATAENTRYGROUP',
        'INSPECTIONSTATUS',
        'GLOBALID',
        'INSPECTIONDATE'
    ],
    false
);

// Define relational fields
var parentField = 'GLOBALID';
var childField = 'PARENTGUID';


//Filter child records by inspection date
var child_date_sql = "INSPECTIONDATE BETWEEN DATE '2025-07-01' AND DATE '2025-09-30'";
var child_interest = Filter(CHILD_DATA, child_date_sql);


// Initialize array for final features
var feats = [];

// Join children to parent
for (var f in parent_interest) {
    var parentId = f[parentField];
    var join_sql = "'"+ childField + "' = '" + parentId + "'";
    var temp_feats = Filter(child_interest, join_sql);

    for (var c in temp_feats) {
        Push(feats, c);
    }
}


// Define schema for virtual FeatureSet
var defi = {
    'fields': [
        {'name': 'REGION', 'type': 'esriFieldTypeString'},
        {'name': 'PARENTGUID', 'type': 'esriFieldTypeGUID'},
        {'name': 'GLOBALID', 'type': 'esriFieldTypeGlobalID'},
        {'name': 'OBJECTID', 'type': 'esriFieldTypeOID'},
        {'name': 'DELETERECORD', 'type': 'esriFieldTypeString'},
        {'name': 'STRUCTURETYPE', 'type': 'esriFieldTypeString'},
        {'name': 'AREA', 'type': 'esriFieldTypeString'},
        {'name': 'INSPECTIONDATE', 'type': 'esriFieldTypeDate'},
        {'name': 'DATAENTRYGROUP', 'type': 'esriFieldTypeString'},
        {'name': 'INSPECTIONSTATUS', 'type': 'esriFieldTypeString'}
    ],
    'geometryType': '',
    'features': feats
};

// Return FeatureSet
return FeatureSet(defi);
0 Kudos
RPGIS
by MVP Regular Contributor
MVP Regular Contributor

I believe @AustinAverill was just an example. You might need to change your Portal and portal item to whatever your data specifies using the structure provided.

0 Kudos
YuriWalsh
Emerging Contributor

I replaced some of the items to be a bit more generic in the example I provided. I used my portal and item in my actual arcade, but I was hoping @AustinAverill might be able to spot an error that I did not see that would magically fix the script haha 😂

0 Kudos
AustinAverill
Frequent Contributor

Unfortunately, nothing is sticking out. However I would recommend adding `console.log` messages throughout the script, especially before, inside of, and after the for loop and running the test to see what part of the script is hanging.

0 Kudos
YuriWalsh
Emerging Contributor

Thank you for taking a look. I will continue to tinker with it and see if I can figure it out. Thank you!

0 Kudos
AustinAverill
Frequent Contributor

Keep me updated! Arcade can be a nightmare to diagnose when issues arise. Especially non-descript issues like "could not execute script" lol

0 Kudos