Select to view content in your preferred language

ArcGIS Online Dashboards: Group-Based Visibility Control Possible?

1306
7
11-01-2023 01:11 PM
JonJones1
Frequent Contributor

Is it possible to create a single comprehensive ArcGIS Online dashboard and customize the visibility of data for different user groups by utilizing features such as "view layers" and user grouping?

Here's the scenario: I need to develop a dashboard for the president of my company, and he requires access to all the data available. Can I assign the president to a user group that provides unrestricted access to all dashboard data? Additionally, can I share the same dashboard with other employees and limit the information they see based on the specific states they are responsible for managing, perhaps by defining user groups and creating view layers?

In essence, my goal is to distribute a primary dashboard while ensuring that each group of users can only access the data relevant to their responsibilities. Is this functionality achievable within ArcGIS Online dashboards without the necessity of creating multiple versions? I'm eager to avoid duplicating the dashboard multiple times, which could lead to about 12 separate versions, and I'm hoping there's a more efficient way.

7 Replies
jcarlson
MVP Esteemed Contributor

Definitely possible with a Data Expression. In a Data Expression, you have access to the function GetUser, which returns information about the currently logged in user, including any groups the user belongs to. You could use that list of groups to apply different filters.

 

var grps = GetUser()['groups']

var fs = FeatureSetByPortalItem(
  Portal('your portal url'),
  'itemid',
  0,
  ['fields'],
  false
)


if (Includes(grps, 'some admin group')) {
  return fs
} else {
  return Filter(fs, "where admins_only = 'yes'")
}

 

 

Now, this would still require the underlying feature layer to have the maximum level of access possible, so an enterprising user could follow the GET requests back to the server and just look at all the data anyway.

Here's a more complicated but interesting approach: change the feature service being accessed based on the group.

 

var grps = GetUser()['groups']

function SpecificView(itemid) {
  return FeatureSetByPortalItem(
    Portal('your portal url'),
    itemid,
    0,
    ['fields'],
    false
}

if (Includes(grps, 'first group')) {
  return SpecificView('itemid of first group view layer')
} else if (Includes(grps, 'second group')) {
  return SpecificView('itemid of second group view layer')
}

 

This has the potential of maybe breaking your dashboard, but only for certain kinds of users. Plus you can't adequately preview the dashboard unless you change the data expression or creating test users. But provided your different view layers had the same fields available, it may be possible.

- Josh Carlson
Kendall County GIS
JonJones1
Frequent Contributor

Hello! It appears that this isn't as straightforward as I initially thought.

ArcGIS Online Dashboard doesn't seem to provide a message like, 'Hey, it appears that you don't have access to the full set of data in the feature layer. However, since you're in a group that has been granted access to one of the view layers of this feature layer, I'll let you see the data you have access to.' Am I correct in understanding that this isn't how it works? Now that I've typed it out, it does seem a bit unrealistic on my part to expect it to work this way.

Assuming that what I mentioned above doesn't work, it seems like I might need to explore data expressions, which are new to me.

With that in mind, I have a quick follow-up question. Where exactly should I set up these data expressions? My dashboard includes a map and various visualizations like pie charts, cards, and tables. Do I need to configure data expressions individually for each of these visualizations and the map? I believe that's the case, but now I just need to figure out how to do that... lol. Do you happen to have a link to a tutorial on this topic?

 

0 Kudos
jcarlson
MVP Esteemed Contributor

A web map can act like that, but it doesn't dynamically replace the blocked layers with other versions, you'd just need to have everything in the map, which would be pretty annoying for your users.

Data Expressions are implemented as the data source for a given widget, and importantly, do not feed into the map. I'm afraid there isn't a way to dynamically alter the map.

- Josh Carlson
Kendall County GIS
0 Kudos
JonJones1
Frequent Contributor

Can you clarify a few points for me? If I understand correctly, you're suggesting that I initialize the map with a feature layer that includes data for all states. Then, each widget would have a data expression that automatically filters information based on the user who's logged in.

Do I have that right? Also, will this approach affect the map content displayed on my dashboard?

0 Kudos
jcarlson
MVP Esteemed Contributor

Not exactly. You can filter all you want, but the layer itself will need to be shared across all groups who might want to look at it. So if there's data that only admin folks should see and you actually want to protect it, that needs to be its own view.

If you have 12 groups with different access levels, you'd need 12 view layers, and each of them would need to be added to the map. But doing so will notify your users that 11 of the 12 layers cannot be added to the map.

Assuming each view layer had the same fields present, you'd just need a single data expression that picks the appropriate itemid based on group membership, and all the dashboard widgets could tie into that.

It's a really intriguing idea, and I'm testing an implementation of it right now. I don't really think this problem has an elegant solution, but it may have an interesting one.

- Josh Carlson
Kendall County GIS
0 Kudos
JonJones1
Frequent Contributor

Thank you so much for dedicating your attention to this issue; I truly appreciate it!

It appears that you fully grasp the situation. Essentially, I possess a master dashboard that presents all my data. My objective is to distribute specific sections of this data to various users, each provided with their own individual dashboard. Crucially, each user should only have access to the data they are authorized to view. When I update the feature layer or alter the layout of my master dashboard, I wish for these changes to be mirrored in their respective dashboards as well.   

On a related note, I often create data-only presentations, without maps, using a web app named Zoho Analytics. It has a very effective way of achieving what I want here. Essentially, you build one dashboard, and when you share it with a user, you set up a filter during the sharing process, so the user can only see the data they are filtered to see. It works perfectly! I really wish ArcGIS Online offered this feature for both its maps and data visualizations in dashboards, instead of requiring the construction and maintenance of so many "identical" dashboard versions for each user.

JonJones1
Frequent Contributor

Hey,
I thought I would share this with you.

I asked a very similar question as this on another message board and received a suggestion of; build the master dashboard as I want it, and then use the ArcGIS API for Python to filter and duplicate the dashboards and webamps filtered as I desired.

I haven't tested this yet, mainly because I currently have no idea how to write the code to do this, but the individual mentioned that they have a workflow like this set up at their current place of business. Overall, this seems like an effective method: keep one updated as desired, and use Python to generate all the filtered versions.


0 Kudos