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 / Is there a PAD equival...
Power Automate
Answered

Is there a PAD equivalent for P/Au Cloud's Get User Profile action?

(0) ShareShare
ReportReport
Posted on by 292

In running a Desktop flow, I need to store the current user's email address.

 

If I were in a Cloud flow I'd get WorkflowInitiator from the TriggerOutputs().

Is there an equivalent to that in PAD?    (using OOB functionality, not getting into C# coding, CMD line scripting, etc.)

 

The closest I can come is to pull the Windows Environment variable for Username. 

I could call a cloud flow that accepts that as a parameter and does a Get User Profile to return the email address.  But that seems awfully klunky.  Surely there's a way to get that info within PAD and I'm just not seeing it.

 

Am I missing something here or did Microsoft?

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Does this count?  It's PowerShell, but "Run PowerShell script" is a built-in action, and the PowerShell is very readable, not dangerous, just "Get Current Name":

     

    Copy this and paste it into a subflow:

     

    System.RunPowershellScript Script: $'''[System.Security.Principal.WindowsIdentity]::GetCurrent().Name''' ScriptOutput=> PowershellOutput ScriptError=> ScriptError
    Text.SplitWithDelimiter Text: PowershellOutput CustomDelimiter: $'''\\''' IsRegEx: False Result=> TextList
    Text.Trim Text: TextList[1] TrimOption: Text.TrimOption.ToEnd TrimmedText=> Username
    SET Email TO $'''%Username%@centralbancorp.com'''

     

    It looks like this:

    MichaelAnnis_2-1639156627213.png

    And you just replace your domain on line 4.

     

    Let me know if this doesn't work for you.

     

  • VJR Profile Picture
    7,635 on at

    Hi @MelissaReed 

     

    I haven't used it but maybe its worth trying the "Get User Info" action of the Active Directory.

     

    VJR_0-1639200063858.png

     

  • VJR Profile Picture
    7,635 on at

    This link from Microsoft Learn will give you help on how to use this action.

    Active Directory handling in Power Automate for desktop - Learn | Microsoft Docs

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    I was looking at this too. It I didn’t see how to get the current user info.

  • MelissaReed Profile Picture
    292 on at

    Tx for the suggestion -- it only returns my "distinguished name" which looks something like xyx42355. 

  • MelissaReed Profile Picture
    292 on at

    @VJR  Thanks for the link.   This doesn't cover how to retrieve properties for the current user.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Were you able to try the PowerShell Script, or is it not allowed?

  • MelissaReed Profile Picture
    292 on at

    @MichaelAnnis Thanks for such a thorough response!    Apologize for the delay, took a while to get a chance to test this.

    1) I learned something:   I can actually paste in the text -- you meant LITERALLY paste it in!   And it generates the Disney boxes.   Cool!

    2) Are there other functions besides GetUser() or .Name?   I was able to get your script to work but it only returned Domain/DistinguishedName    (ex: XXX\fjf45623)   I googled it to see if I could get more documentation on GetUser struck out.   Any ideas?

     

    What I'm ultimately trying to do is get the current user's email so I can pass it to another process.

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    The split text and trim text in the previous post gets the username out of domain/username.  The split text separates them, and then the trim text removes a ghost space at the end of username, not sure why it shows up. 

  • MelissaReed Profile Picture
    292 on at

    @MichaelAnnis Maybe it's a quirk of my particular environment, but Username is not "John Smith" or John.Smith that I could tack an "@domain.com" onto.  It's something like fjf24332.    In Power Automate Cloud, I can use that value as a parameter for the cloud action  Office/Get user profile (V2) and pluck off the "Mail" property from the return value.   

     

    My workaround is to pass that User code (not a name, the fjf42343 value) into the Cloud flow do the lookup there.

    But what if this were a standalone PAD flow, where I would need to record the current user's email address.  I can't believe there's not a built-in for that.   

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 237 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 194

Last 30 days Overall leaderboard