Select to view content in your preferred language

Data Expression or Filter in Dashboard Based on User in Related Table

91
0
Wednesday
Labels (1)
GIS_utahDEM
Frequent Contributor

I'm wondering if it's possible to filter a featureset based on a filtered related table? Essentially I am trying to create a data expression that only returns features relevant to the logged in user. I can pull the name for the logged in user, and I can filter the related table so I have a list of correct parent IDs, but I'm trying to figure out how to then filter the parent hosted feature layer to only include features that match the list of correct parent IDs. 

Including a diagram to explain better:

1) I get the logged in user's name, let's say it's "Amy" in the screenshot

var fs = FeatureSetByPortalItem(portal, '8e437a67551e4acab0487bcde4dc2c8c',0,["objectid","globalid","project_name","project_id"])
var fs_2 = FeatureSetByPortalItem(portal, '8e437a67551e4acab0487bcde4dc2c8c',1,["objectid","globalid","parent_project_id_pt","team_member_name"])
var curr_user = GetUser(portal)['fullName']

2) I filter the Related Table to only include features that match "Amy" (in the screenshot)

var fsFiltered = Filter(fs_2, "team_member_name = @curr_user")

3) How do I use arcade in data expressions/dashboards to return the featureset filtered to only include "Project 1" and "Project 3", since those are the only ones that have Amy matched in the related table?

GIS_utahDEM_1-1749664194285.png

 

0 Kudos
0 Replies