Load default CollectionMemberValue filter based on user's group membership

I’m looking for a way to automatically set the default member filter value based on the group the user is a member of. I want to place the script under the Ready actions under the Main tab but not sure how to do it. For example, if a windows account is a member of group A, the component filter should default to the data for group A and if windows account is a member of all or some of the groups, component filter should default to the token “All” and still see the rest of the data. I’m also unable to use the RLS feature as it doesn’t work with the visualization I’m working on so I’m trying to find a work around instead.

Thanks in advance!

Hello @maria,

One solution could be the following: you can create a “master” group for all the specific groups in Dundas. The next step is to create a query(Data Cube) on the Dundas App DB which will retrieve the Group Names and the ID’s of these groups. Base on this cube, you should create a table into the dashboard.
After these steps, you have to write a script which is taking the ID’s of the membership groups for each user (on ready).
var group=dundas.context.currentSession.windowsGroupAccountMembershipIds;
Using these ID’s(from the script) you can compare it with the ID’s (from the DataCube) which are coming from the DataCube and with several for and if clauses you can implement different rules for filtering, security etc.