cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alexander75671
Regular Visitor

SharePoint and Get User Profile

I am attempting to build a flow. The trigger is when an item is created in SharePoint, start the flow. I want to also grab the user's phone number and display name to be included in the email notification so I used "Office 365 Users: Get User Profile". 

 

The issue is that "Office 365 Users: Get User Profile" wants the UPN of the user. The closest I can get with "SharePoint: When an item is created" is Created By Email Address, which is not always going to reliably work. 

 

Any ideas of a way to get the UPN from email address or SharePoint Created By?

10 REPLIES 10
faustocapellanj
Memorable Member
Memorable Member

Hi @alexander75671,

 

The thing is the UPN is the email address. I just ran a test flow and used the Created By Email available in the Dynamic content. It returned my email address as the User Principal Name. See screenshot below:

UPN.JPG

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!
alexander7567
New Member

Well yes, the UPN is typically the same as the email address but not in all instances.

When we have a user in our organization change their name, we update their email address, but both their login name, or UPN. So in these cases, the flow would fail and the email notification would not be sent.
alexander7567
New Member

Correction.. had a typo.

When we have a user in our organization change their name, we update their email address, but we do not update their login name, or UPN. So in these cases, the flow would fail and the email notification would not be sent.
v-xida-msft
Community Support
Community Support

Hi @alexander75671,

 

Where do you update email address of the user?

Which email address do you update? The email address of the User name or the email address of Authentication contact info in User profile of Azure Active Directory?

Further, could you please share a bit more about the error message of the failed flow?

 

The login name of Office 365 User would map to a unique UPN, if we update the email address of User name, the UPN would make corresponding changes.

 

I have made a test on my side and the flow works well. Please check if you have update the connection of “When an item is created” trigger.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I'm not getting an error yet because I know it won't be reliable so it's not in production yet. 

 

The UPN is NOT the email address. The UPN is <username>@<domain>.com. The email address is just the email address. The domain could change but not the email, the username could change but not the email. There just needs to be an option to get the UPN from the SharePoint: When an item is created.

 

It works for me too because my email address is also my UPN, but there are instances where that is not always the case. I have two users wrote down that I quickly found that are this way. It will cause the Flow to fail.

 

https://lostandfoundidentity.wordpress.com/2012/03/22/dude-what-is-my-upn-or-wait-is-it-an-email-add...

 

 

Hi @alexander75671,

 

Thanks for the info in your previous post. My understanding from your original post is that you want to get the user's phone number and display name so it can be included in the email notification. Since the flow will run within the context of the user submitting the list item, you should try the "Office 365 Users - Get my profile". From there you should be able to extract the UPN without having to enter the user's email address since this step does not require additional input.O365-GetMyProfile.JPG

 

Please let us know if that works for you.

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Ahh - so even though the flow is using my credentials, it would still grab the user's who submitted the item's info? If that's the case, that would resolve my issue for now.

 

But I still think there should be a way to grab the UPN for other items like this.

@alexander75671,

 

I agree there should be other ways to get the UPN, but I guess we'll have to wait to see if there will be another way thru flow. On the meantime, test that with some of your users and let me know how the testing goes. Also, if this solves your issue, please mark it as solved in the event other users are faced with the same issue or question.

 

Please let me know if I can be of further assistance.

 

Regards,

Fausto Capellan, Jr

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Tested it and it returns my information (since I have the connection setup under my account for now), not the user that submits the form. So that did not resolve my problem.

@alexander75671,

 

I see what you mean. I created a new SharePoint item using a test account and my info was retrieved in the Get my profile step. We'll have to check with someone from the staff to see if this is the expected behavior of this step.

 

Hi @v-xida-msft, can you please verify my statement above? Thank you

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,510)