Forum Discussion
RLS multiple usernames
Hi AllisonKennedy,
Exacatly but UserPrincipalName is [email protected] and not [email protected] so I need the RLS code to UserPrincipalName ([email protected]) = Key [email protected] (but remove 1001 in RLS logic) so it matches. Again, with UserPrincipalName equal to one store, its no problem.
Here is my Power Automate flow:
MIkkelHyldig I think if you update the power automate to use the 'key' column instead of the UPN value that should do the trick? I think... let me know if it works as I haven't used that action in Power Automate so will be interested to know if you can 'cheat' the UPN in that way.
- MIkkelHyldig3 years agoHelper II
Hi AllisonKennedy,
Key doesnt work unless my DAX handles the UserPrincipalName+StoreNo to equal UserPrincipalName. Im working on the issue later this week and will give a solution if found.
Thanks for the inputs so far!- AllisonKennedy3 years agoCommunity Champion
MIkkelHyldig You may need to use USERNAME() instead of USERPRINCIPALNAME
For reference for others, I'm using this article to find details of the Power BI action (had to look up what info it wanted for the dataset): Export and email a report with Power Automate - Power BI | Microsoft Learn
It worked in my test scenario:
Note that the Identities Username -1 value for dynamic content is using the "Key" column from the database, not the UserPrincipalName. You can use two columns here if you don't have that concatenated in SQL already (I don't have a SQL database in my test tenant so just used manual input to demo).
Run the flow using inputs of 11001 and 11002 as the UPN-Key values and here's the outputs:
- MIkkelHyldig3 years agoHelper II
HI AllisonKennedy
Are you running the flow Export to File for PBI in a Apply to each flow or simply getting two seperate emails for 11001 and 11002? And second, how can the RLS rule customerkey be equal to username? My username is NAME\Mikkel.Hyldig and the Key column im using is [email protected]?
I have no issues getting the flow to run at its own with the userprincipalname for one store no at a time but when I wrap a Apply to each action around it keeps looping the userprincipalname for the same Store no 7068.