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 / Save Email attachment ...
Power Automate
Answered

Save Email attachment and rename file using domain email and date

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have a working flow that save attachments to SharePoint and I would like now that the flow rename the file with the date of the email and the domain of the email.

 

For example I receive a PDF today 08.11.2022 and the sender is qwerty@company.com 

My expected name file is company.08.11.2022

 

My flow is running but the name file is not being edited. I'll attach screens of my flow. 

I initialized first a variable and then I do an Apply to each where I set a variable then I get the email domain thanks to an expression working with examples (slice(triggerBody()?['From'], add(indexOf(triggerBody()?['From'], '@'), 1), lastIndexOf(triggerBody()?['From'], '.')) and then I concatenate it with the date : concat(outputs('Get_Email_Domain'), '_', formatDateTime(utcNow(), 'yyyyMMdd'), '.')

 

After that my previous flow runs with an apply to each with condition and a create file with in file name the variable VarName that I created previously. 

 

Can someone spot my error? Why the name file is not being edited ? 

Many thanks 

 

1.PNG
2.PNG
Categories:
I have the same question (0)
  • Verified answer
    v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @eder109 ,

    Do you want to rename incoming attachments and save them in Sharepoint?

    You also need to get the suffix of the attachment and use the Get Attachment action to get the content of the attachment.

    Below is my test for your reference.

     

    concat(split(split(triggerOutputs()?['body/from'],'@')[1],'.')[0],'.',formatDateTime(utcNow(),'yyyy.MM.dd'),'.',split(item()?['Name'],'.')[1])

     

    vdezhilimsft_0-1667971633280.png
    vdezhilimsft_1-1667971633282.png
    vdezhilimsft_2-1667971633283.png
    Best Regards,
    Dezhi
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard