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 / Get Sender Name from O...
Power Automate
Unanswered

Get Sender Name from Outlook Shared mailbox using Power Automate Desktop

(0) ShareShare
ReportReport
Posted on by 49

I'm trying to retrieve the Sender Name (NOT the From Email address) from Outlook emails. I use the Retrieve Emails and can get the .From address but don't know the syntax to retrieve the Sender Name value?

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @mstjohnsomc 

     

    Based on my understanding, there isn't a prebuilt option in PAD to retrieve the sender's name. Alternatively, you can create a cloud flow as web service and utilize the "Get User Profile" action to achieve this. Here's a suggested flow:

     

    1. Launch Outlook.
    2. Retrieve email details.
    3. Call the cloud flow as a web service, passing the sender's address as a parameter.
    4. Retrieve the sender's details as output from the cloud flow.

    Let me know if you need further clarification or assistance with this approach.

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

     

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @mstjohnsomc ,

     

    As per my understanding please find the steps for your solution.

     

    Steps:
    1.Get Emails from Shared Mailbox
    2.Loop through Retrieved Emails
    3.Extract "Reply-To" Address
        syntax : GetItemFromArray(GetOutlookMessagesOutput, loopIndex)

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

     

  • kinuasa Profile Picture
    799 Most Valuable Professional on at

    Does what you are saying mean that with the "Retrieve email messages from Outlook" action, you can retrieve the messages and get the sender's address from the From property, but you cannot get the sender's name because that property does not exist?

     

    If that is the case, you can use VBScript to retrieve information from the EntryID property, including the sender's name.

     

    WScript.Echo GetObject(, "Outlook.Application").Session.GetItemFromID("%RetrievedEmails[0].EntryID%").SenderName

     

    PAD_GetMailSenderName.jpg

    If the script cannot retrieve anything, try displaying a message box that automatically closes before the Run VBScript action.

    PAD_GetMailSenderName(2).jpg

     

     

  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @kinuasa - This is another fantastic approach and workaround to get the sender name

  • mstjohnsomc Profile Picture
    49 on at

    This approach would likely work for internal or users within our Exchange environment, but not external. 

  • mstjohnsomc Profile Picture
    49 on at

    I'm looking for the Sender.Name value - NOT the email address.

  • mstjohnsomc Profile Picture
    49 on at

    Thanks Kinuasa (you also replied on the PAD Discord environment) but this doesn't return any value - as I'm assuming the PAD Retrieve Email action simply doesn't get the Sender.Name attribute

  • kinuasa Profile Picture
    799 Most Valuable Professional on at

    @mstjohnsomc wrote:

    This approach would likely work for internal or users within our Exchange environment, but not external. 


    If you can obtain the Entry ID from the email, I believe you can handle it by using the GetSharedDefaultFolder method as shown in the code below.

     

    • %SharedMailboxAddress%: Shared mailbox address
    • %EntryID%: Mail Entry ID
    Dim olApp 'Outlook.Application
    Dim rp 'Outlook.Recipient
    Dim itm 'Outlook.MailItem
    Const olFolderInbox = 6
    Set olApp = GetObject(, "Outlook.Application")
    Set rp = olApp.Session.CreateRecipient("%SharedMailboxAddress%")
    rp.Resolve
    If rp.Resolved Then
     With olApp.Session.GetSharedDefaultFolder(rp, olFolderInbox).Session
     WScript.Echo .GetItemFromID("%EntryID%").SenderName
     End With
    End If
  • kinuasa Profile Picture
    799 Most Valuable Professional on at

    You can also use a script like the one below to retrieve information from emails in a shared mailbox without using the "Retrieve email messages from Outlook" action.

     

    • %SharedMailboxAddress%: Shared mailbox address
    Dim olApp 'Outlook.Application
    Dim rp 'Outlook.Recipient
    Dim itm 'Outlook.MailItem
    Dim ary(), i
    Const olFolderInbox = 6
    
    Set olApp = GetObject(, "Outlook.Application")
    Set rp = olApp.Session.CreateRecipient("%SharedMailboxAddress%")
    rp.Resolve
    If rp.Resolved Then
     With olApp.Session.GetSharedDefaultFolder(rp, olFolderInbox)
     ReDim ary(.Items.Count - 1)
     For i = 1 To .Items.Count
     ary(i - 1) = .Items(i).Subject & vbTab & .Items(i).SenderName
     Next
     End With
     WScript.Echo Join(ary, vbCrLf)
    End If

     

    Here is a sample flow:

    PAD_retrieve information on emails in shared mailbox.jpg

    SET DataTable TO { ^['Subject', 'SenderName'] }
    SET SharedMailboxAddress TO $'''shared@***.onmicrosoft.com'''
    Outlook.Launch Instance=> OutlookInstance
    @@copilotGeneratedAction: 'False'
    Scripting.RunVBScript.RunVBScript VBScriptCode: $'''Dim olApp \'Outlook.Application
    Dim rp \'Outlook.Recipient
    Dim itm \'Outlook.MailItem
    Dim ary(), i
    Const olFolderInbox = 6
    
    Set olApp = GetObject(, \"Outlook.Application\")
    Set rp = olApp.Session.CreateRecipient(\"%SharedMailboxAddress%\")
    rp.Resolve
    If rp.Resolved Then
     With olApp.Session.GetSharedDefaultFolder(rp, olFolderInbox)
     ReDim ary(.Items.Count - 1)
     For i = 1 To .Items.Count
     ary(i - 1) = .Items(i).Subject & vbTab & .Items(i).SenderName
     Next
     End With
     WScript.Echo Join(ary, vbCrLf)
    End If''' ScriptOutput=> VBScriptOutput
    Text.SplitText.Split Text: VBScriptOutput.Trimmed StandardDelimiter: Text.StandardDelimiter.NewLine DelimiterTimes: 1 Result=> Lines
    LOOP FOREACH CurrentItem IN Lines
     Text.SplitText.Split Text: CurrentItem StandardDelimiter: Text.StandardDelimiter.Tab DelimiterTimes: 1 Result=> Columns
     Variables.AddRowToDataTable.AppendRowToDataTable DataTable: DataTable RowToAdd: [Columns[0], Columns[1]]
    END

     

  • kinuasa Profile Picture
    799 Most Valuable Professional on at

    I'd forgotten to write it.
    Please turn off the Cached Exchange Mode when the GetSharedDefaultFolder method fails.

     

    * Turn on Cached Exchange Mode - Microsoft Support
    https://support.microsoft.com/en-us/office/7885af08-9a60-4ec3-850a-e221c1ed0c1c?WT.mc_id=M365-MVP-4029057

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
David_MA Profile Picture

David_MA 229 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 227

#3
Haque Profile Picture

Haque 181

Last 30 days Overall leaderboard