web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / "Retrieve e-mail messa...
Power Automate
Answered

"Retrieve e-mail messages from Outlook" with Multiple Accounts

(0) ShareShare
ReportReport
Posted on by 8

For the "Retrieve e-mail messages from Outlook" function, is there a way to have the account field auto-populate based on who is running the flow?  For instance, we are using this step for one of our flows, but we have to either save different copies of the flow with the account field changed to that user's e-mail account or have to go in and update it manually with that user's e-mail account before the flow can be ran.  Is there a way for the flow to look at who is running the flow and automatically sync it with that user's Microsoft account and e-mail address?

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @dathompsonmerc 

     

    One question, is the user be the one by which bot has logged into the machine , like user of machine or user from cloud from which desktop flow is triggered ?

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    I think @Nived_Nambiar and I have the same idea.  I thought there was a “Get User” action, and then you could run a new variable off a switch base md on the result of Get User. If you can’t find a get user action, try command line. Just google get user via command line.  Let us know if you need any more clarification or help with the above options. 

    best of luck!

  • Verified answer
    momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    A number of options here; I think we all, with @Nived_Nambiar and @MichaelAnnis think in the same direction.

    Two options as an example:

     

    If this flow is to be executed manually via a console on the user's desktop, you can get the UPN of the logged-in user with this cmd command. This will give you an email address if your AD is using that field in AD user objects. Otherwise, it will throw an error, and you will need to know where you store the email address and then query using PowerShell, for example.

    whoami /upn

     

    Suppose this flow is meant to be executed via Power Automate flow triggered manually by the user. You can get the user's email address who triggered the flow and pass it to PAD via the input variable.

     

    In both cases there would not be the need to alter the flow for different users.

  • dathompsonmerc Profile Picture
    8 on at

    The user would be logged onto their machine.

  • dathompsonmerc Profile Picture
    8 on at

    Thank you @MichaelAnnis 
    I'll give this a try.

  • dathompsonmerc Profile Picture
    8 on at

    Thank you as well, @momlo 
    I'll give this a try as well.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 245

#2
David_MA Profile Picture

David_MA 216 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 212

Last 30 days Overall leaderboard