cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alexander75671
Level: Powered On

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
Super User
Super User

Re: SharePoint and Get User Profile

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!

Proud to be a Flownaut!


Highlighted
alexander7567
Level: Powered On

Re: SharePoint and Get User Profile

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
Level: Powered On

Re: SharePoint and Get User Profile

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.
Community Support Team
Community Support Team

Re: SharePoint and Get User Profile

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.
alexander75671
Level: Powered On

Re: SharePoint and Get User Profile

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...

 

 

Super User
Super User

Re: SharePoint and Get User Profile

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!

Proud to be a Flownaut!


alexander75671
Level: Powered On

Re: SharePoint and Get User Profile

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.

Super User
Super User

Re: SharePoint and Get User Profile

@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!

Proud to be a Flownaut!


alexander75671
Level: Powered On

Re: SharePoint and Get User Profile

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.

Super User
Super User

Re: SharePoint and Get User Profile

@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!

Proud to be a Flownaut!


Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,357)