cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Memorable Member
Memorable Member

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!
New Member

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.
Highlighted
New Member

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

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.
Highlighted
Regular Visitor

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

 

 

Highlighted
Memorable Member
Memorable Member

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!
Highlighted
Regular Visitor

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.

Highlighted
Memorable Member
Memorable Member

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!
Highlighted
Regular Visitor

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.

Highlighted
Memorable Member
Memorable Member

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!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,464)