Forum Discussion

nok's avatar
nok
Advocate II
11 months ago
Solved

RLS based on two email columns

Hi!

I want to create a RLS that's different from the ones I've done before, and I'm experiencing some difficulty. I have a table with two columns (Owner, Creator) containing user emails, as follows:

Value   OwnerCreator
17[email protected]   [email protected]     
55[email protected]  [email protected]  
46[email protected] [email protected] 

 

I want to create a RLS for this table that checks whether the user has an email address in one of these two columns (Owner or Creator). If so, they can view the data in that row; if not, the dashboard won't display that row. So, for example: if the user [email protected] opens the dashboard, he will only see the data from the first row, as well as [email protected], as these two users have the email in one of these two columns for the first row only.


How can I do this?

  • Hi nok just create a new role and pest this dax 

    [Owner] = USERPRINCIPALNAME() || [Creator] = USERPRINCIPALNAME()

     

    It will check both if user email is match with Owner or Creator columns then show associated results. 

     

    Find this helpful? ✔ Give a Kudo • Mark as Solution – help others too!

1 Reply

  • Hi nok just create a new role and pest this dax 

    [Owner] = USERPRINCIPALNAME() || [Creator] = USERPRINCIPALNAME()

     

    It will check both if user email is match with Owner or Creator columns then show associated results. 

     

    Find this helpful? ✔ Give a Kudo • Mark as Solution – help others too!