Forum Discussion
Dynamic RLS based on many to many relationships. between two tables
- 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
- 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
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
- Optimusprime_253 years agoResolver I
Thanks amitchandak , I have implemented your solution and it's working.