cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Atonkin89
New Member

Obtain UPN from first name and last name

I have a list of user names from a legacy system in the format 'lastname, firstname'.  I need to obtain the UPN for the person so I can send an email in Power Automate.  After researching for awhile I still can't figure it out.  I've tried Search for Users and Get User Profile with no luck.  Any help would be greatly appreciated! 

1 ACCEPTED SOLUTION

Accepted Solutions
VJR
Memorable Member
Memorable Member

Hi @Atonkin89 

 

When the Last name, First name is passed to the Search users..

VJR_1-1638790818610.png

 

It correctly shows up both the email as well as the UPN Id.

 

VJR_2-1638790987542.png

 

Couple of things to check:

- As a sample test, pass a valid email address as the UPN to the "Search users" or "Get user profile" and after running the flow in the output check for the format of the DisplayName parameter.

VJR_3-1638791129996.png

In my case it is Last Name, First Name. And if I pass vice versa ie; First Name, Last Name it does not work.

Check how is it in your case. For eg; if it is first name, last name then in your flow use this format.

 

- If possible also ask your IT to show some sample records as to how they are stored in the AAD (Azure Active Directory) and which fields are stored.

 

 

 

View solution in original post

3 REPLIES 3
VictorIvanidze
Resident Rockstar
Resident Rockstar

Please show your flow in that you have tried yo use "Search for users" action.



Freelance Power Automate developer. $50 per hour.
VJR
Memorable Member
Memorable Member

Hi @Atonkin89 

 

When the Last name, First name is passed to the Search users..

VJR_1-1638790818610.png

 

It correctly shows up both the email as well as the UPN Id.

 

VJR_2-1638790987542.png

 

Couple of things to check:

- As a sample test, pass a valid email address as the UPN to the "Search users" or "Get user profile" and after running the flow in the output check for the format of the DisplayName parameter.

VJR_3-1638791129996.png

In my case it is Last Name, First Name. And if I pass vice versa ie; First Name, Last Name it does not work.

Check how is it in your case. For eg; if it is first name, last name then in your flow use this format.

 

- If possible also ask your IT to show some sample records as to how they are stored in the AAD (Azure Active Directory) and which fields are stored.

 

 

 

That fixed it! Thanks for sharing how to validate the format of Display Name, when I used the correct format it worked.  I appreciate your help

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,431)