Hello everyone,
I’m working on a dashboard and I’d like to create an automatic filter based on the username of the user who accesses it. The filter should be applied to a field different from 'Creator'. Let me clarify: a user accessing the dashboard should only see the records related to their company, but these records were created by a different account, so I can’t use the Feature Layer settings. I was thinking of using a data expression with a filter based on the user.
Is a data expression a possible solution? Do you have any examples or guidance to share? Alternatively, how could I approach this?
Thank you!
Solved! Go to Solution.
You can create a view that does the current user filtering for you and then build your dashboard off of that view.
Display Features Relevant to the Current User
I haven't done this (nor am I certain it's possible), but if commercial sensitivity is crucial I'd recommend using hosted feature layer views and separate dashboards for each company rather than a dynamic filter in a dashboard. Using filters at map/app levels means users can still access the feature layers at the service level and bypass those filters.
This is absolutely true. Normally, I would work with separate views and dashboards, but in this case, I have agricultural companies from the entire region—potentially exceeding 5,000 units—which is unfeasible. That's why I'm looking for a dynamic filter. I need data cleanliness on the map more than ensuring that users see all the data from the FL.
Hi @Davide_Pili ,
It might be possible, and probably far fetched, but you might be able to use arcade to get the username and create a custom set of features within the dashboard as an extra dataset.
Thanks @RPGIS
I had already tested this approach, but I couldn't get it to work. The solution that follows was faster and worked right away.
Thanks anyway
You can create a view that does the current user filtering for you and then build your dashboard off of that view.
Display Features Relevant to the Current User
Thanks @JenniferAcunto
it works. that's what I was looking for.
Very quick and easy procedure.
Thanks again