Forum Discussion

Optimusprime_25's avatar
Optimusprime_25
Resolver I
3 years ago
Solved

Dynamic RLS based on many to many relationships. between two tables

Hello All,   We have two tables in the report. One is report table which contains data, multiple columns along with country and unit as columns. We have another table where we have user access de...
  • amitchandak's avatar
    3 years ago

    Optimusprime_25 , Create a combine column

     

    Key = [Country] & "-" & [unit]

     

    for the direct query, you use combinevalues

     

    then you can create RLS using the user 

     

    [user_id] = userprincipalname()

     

    How to use Row Level Security (RLS): https://youtu.be/NfdIA0uS6Nk

  • HiraNegi's avatar
    3 years ago

    Hi Optimusprime_25 ,

    You may follow below steps with sample scenario.

     

    1. Main Data with custom column to concat Country and Unit:

     

    2. User Data with custom column to combine Country and Unit.

     

    3. Create join between tables on ID field.

     

    4. Create new role with filter on UserID = userprincipalname()

    This will dynamically filter the dataset for the user login mail id.

     

    5. Verify if the roles are working as expected.

     

    Hope this helps.

     

    Regards,

    Hira Negi

     

    Please don't forget to upvote and Accept as answer if the reply is helpful