Using User Attributes in AML
By using User Attribute in AML, you can mask the data you don't want your users to see, or manipulate how the values will be returned based on User Attribute setup of the current logged in users.
Please follow our examples below to understand more how it works:
- Hide user emails if staff level is not Executive or Regional Manager
- Display field values based on User Attributes
Hide user emails if Viewers and Explorers dont't belong to Executive or Regional Manager teams
Use-case
You only want to display sensitive info such as user emails to the Viewers/Explorers who are in Executive or Regional Manager teams.
In this example, you will have Data Model users
as below
How-to
There are 3 main steps
- Create User Attribute Level and assign approriate level (Executive, Regional Manager, Staff, etc.) to each user
- Create custom field
email_censored
which only allows users who have Level assigned with Executive or Regional Manager to view, hide the original email field - Test your setup
1. Setup User Attributes
You need to create User Attribute level
and set an appropriate level for each user.
CEO User Attributes
Staff User Attributes
2. Create email_censored
field
In Data Model users
, create a new field email_censored
which only allows the logged-in users to see the email if 'Executive' or 'Regional Manager' matches one of the values in their User Attribute level
. Then hide or delete the original admin_email
field, so Explorers or Viewers won't be able to access it.
3. Test
Finally, test your setup in your datasets and dashboards using View and Edit as feature.
CEO's view
Normal staff's view
Display field values based on User Attributes
Use-case
Default GMV is in USD, for users who are in Singapore you want to show GMV in SGD, and for users who are in Vietnam you want to show GMV in VND.
How-to
Firstly, set up User Attribute currency
for each user in User Management
Then, in your Data Model or Dataset, create a new field Localized GMV
which returns appropriate GMV value according to the currently logged in user's User Attribute currency
Test your logic with Edit and View as feature