I was wondering if there is a way in which we can retrieve name of the user logged in to the SharePoint Site, store it in an array or a variable and use it later in Send an email action.
Solved! Go to Solution.
As was already mentioned. Flows that run off automated triggers run in the context of the user who created them. So any attempt to get the logged in user that way would return your own user. Using the trigger you are using you could retrieve the email address (UPN) of the person who modified the item. Their display name is also available.
Also, the get my profile properties action you are using will try to retrieve the user properties of the maker of the flow.
This is possible in the context of a Power App, but unless a Flow is started from a Power App button the flow will run in the context of the user who created the flow. In that case it is the original maker who is logging into the SharePoint site to process things and there is no user login.
One other case is possible. If you are using a trigger that is related to a user's action, like modifying a file, then you could also get the name of the user who modified the file or item.
How can I get the username if I use Power App for triggering the flow?
Not sure I understood the scenario.
If you are looking for the user that has created an item in a SP list, or has modified it, just need to get its ID or even its email address by checking Created/Modified object metadata column value. If you need extra info you can use Office 365 users connector
Hope this helps
Proud to be a Flownaut!
The user who is logged into the system basically fills a SP Form. There is a flow which collects the data from the form, formats it and then uses send an email action in which the data collected is appended into the email body.
All I need is the name of the person who is logged in and is filling the form because the same person will later submit the form which will trigger a send an email action in the background where I need to add his/her name in the Email body.
The name of the user running the Power App will be available as
User().FullName
inside the Power App. You can pass that as a parameter to the Flow using the Run() command in Power apps and then store it in a variable.
Hi @flowuser-21 ,
Your requirement to retrieve name of the user logged in to the SharePoint Site is not supported in microsoft flow currently.
Best regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is what I tried but there seems to be some error.
As was already mentioned. Flows that run off automated triggers run in the context of the user who created them. So any attempt to get the logged in user that way would return your own user. Using the trigger you are using you could retrieve the email address (UPN) of the person who modified the item. Their display name is also available.
Also, the get my profile properties action you are using will try to retrieve the user properties of the maker of the flow.
Thanks. It worked properly!!
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
45 | |
43 | |
38 | |
36 | |
23 |
User | Count |
---|---|
47 | |
31 | |
29 | |
29 | |
28 |