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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Adding Sender's Displa...
Power Automate
Unanswered

Adding Sender's Display Name to Saved Email Attachments in Office 365 Flow

(0) ShareShare
ReportReport
Posted on by 8

Hi,

 

I set up a workflow using the template "Save Office 365 email attachments to specified OneDrive for Business folder.

I need to append the sender's display name from the "From" field to the beginning of the saved attachment. When I use the "From" field it appends the email address and not the person's display name.

How do I extract and add the display name and append it to the file attachment instead?

 

Thanks,

Michelle

Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @michellebelle You will need to add an additional action to your flow. However, keep in mind that this will only work for internal email addresses.

     

    Add a Get user profile (V2) action and insert the From dynamic content into it. This action will search for the user's profile based on their email address.

    creativeopinion_1-1699564203184.png

    You can then use the Display Name dynamic content from the Get user profile (V2) action. 

    creativeopinion_3-1699564274223.png

     

    creativeopinion_2-1699564255693.png

     

     

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

     

  • michellebelle Profile Picture
    8 on at

    Thank you for the response! I am looking to do this for emails that come from outside our organization. To be more specific, the attachment is from a candidate and the email has their attached resume.

     

    So for example, this email:

    From: Jane Doe<jane@soandso.com>

    Subject: Myresume

    Attachment:myresume.pdf

     

    The saved file name should be: Jane Doe -myresume.pdf

     

  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @michellebelle In that case you will need to use an expression. 

    Get the Name

    You can use a Compose action to compose your file name. Insert an expression and use the split() function.  

     

    creativeopinion_6-1699576846111.png

    Click on the Dynamic content tab and insert the From dynamic content into the split() function. 

     

    creativeopinion_7-1699576891544.png

    Add a comma and a < between single quotes.

    creativeopinion_8-1699576992070.png

     

    This function will split the From string of text at the < into an array. To get the first item of the array (which is the name) you'll need to wrap the entire expression in a first() function.

    [

    "Jane Doe",

    "jane@soandso.com>"

    ]

    Press the Up Arrow Key to go to the start of the expression and enter:

    first(

    creativeopinion_10-1699577290028.png

    Press the Down Arrow Key to go to the end of the expression and insert a closing bracket.

     

    creativeopinion_9-1699577114752.png

     

    This is what it should look like. 

    creativeopinion_11-1699577335656.png

    You can use the outputs of this Compose action in your flow where you save the attachment to your OneDrive.

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

     

  • michellebelle Profile Picture
    8 on at

    Thank you. I think I am a little out of my league. Where do I insert the "Compose" action? This is what I have so far.

    michellebelle_0-1699625629366.png

     

  • VictorIvanidze Profile Picture
    13,073 on at

    Hi @michellebelle,

    add the action "Export email (V2)" and parse its output to find the From: header.

    It will work for any message, not only for internal one.

     

  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @michellebelle You would need to insert the Compose action within the Apply to Each loop just before your create file action. Unfortunately, you won't actually be able to insert an action above the Create file action. You'll have to insert it below, then drag and drop it so it appears above.

  • michellebelle Profile Picture
    8 on at

    Thanks for the help guys. I think the problem I've run into is that PowerAutomate doesn't provide acess to the "Display Name" of an email field. It only provides the email address and that is what the Dynamic Field "From" is limited too. Does that make sense?

  • VictorIvanidze Profile Picture
    13,073 on at

    Did you read my answer?

    Power Automate provides access to the email SMTP headers.  One of these headers is

    From: John Doe <jdoe@contoso.com>

    To get the headers you need to use the "Export email" action.

  • michellebelle Profile Picture
    8 on at

    I did see your post, but I guess what I am failing to understand is how to write some code that performs the action I need. I can't seem to find any information on how to access the SMTP headers using the "Export email" action. Is there a reference you could link me too or some additional code you could suggest?

  • VictorIvanidze Profile Picture
    13,073 on at

    Just try to execute the "Export email" action and see its output.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard