PowerAutomate – User claims to UserPrincipalName

We have encountered a situation while working on an older Powerautomate flow that needs some modification.

It requires UserPrincipalName instead of User Email. (People picker)

It sounds to be simple but there is no dynamic field to accomplish this..


Now what should we do? On researching we have found a solution to achieve it..

We can utilize Get User profile activity.


It takes UPN or id field.

How to get the id for the user? (We do not have UPN so not talking about it as we are after that only.)

  1. Create a Variable and Set its value to User Claims (from Dynamic)


  1. Use Compose activity with replace expression as below:

replace(variables(‘AccountID’),’i:0#.f|membership|’,”)


  1. Utilize Get User profile with output of compose from previous step.


Now you have many values from user profile. We are only after UPN so we will get it from here as dynamic value.

If you want any other value that’s also possible (see below screenshot of Dynamic values)


I hope this solution will assist you in your automation need if you are in similar situation.

 

 

Thanks for reading …

Tech Wizard

 

https://techwizard.cloud

https://syscloudpro.com/

PowerShell Fast Track

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s