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?
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:
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.
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.
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.
Please let us know if that works for you.
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.
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.
Fausto Capellan, Jr
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.
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