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 Attachement from ...
Power Automate
Answered

Save Attachement from email and rename file without date

(0) ShareShare
ReportReport
Posted on by 7

Hi, I am new with Power automate.

 

I am trying to save attachement from email into a my own folder. This parts works well if I only use the name of the file. My issue is to save this file with the another name.

 

The files comes with a project name follow by the date of the day. Example: 56Afnvproject_20220815.xslx. I would like to delete the date at the end of the file so other system can find the file.

 

My daily email only contains one file. 

 

Thanks,

 

Pierre

Categories:
  • Verified answer
    MarconettiMarco Profile Picture
    3,812 Super User 2024 Season 1 on at

    Hello @Pierre_EOLEN ,

    in the number of last characters to be removed is always the same, you can follow this steps:

    1. Add the "Get attachment (V2)" action:

    The Message Id and Attachments Attachment Id are grabbed from the Trigger

    MarconettiMarco_0-1660888940808.png

    2. Add a "Compose" action in which put the following expression:

    substring(items('Apply_to_each')?['name'],0,sub(length(items('Apply_to_each')?['name']),14))

    This function will remove the last 14 characters, including the extension ".xlsx"

    MarconettiMarco_1-1660889064921.png

    3. Add the OneDrive "Create file" action, where put the previous Compose outputs in the "File Name" +.xlsx

    MarconettiMarco_2-1660889151883.png

    Add the "Content Bytes" value, grabbed from the "Get Attachment" action, in the "File Content" field.

     

    If I have answered your question, please mark my post as Solved.
    If you like my response, please give it a Thumbs Up.

    BR,

    Marco

     

     

  • Pierre_EOLEN Profile Picture
    7 on at

    Thanks a lot Marco,

     

    If people are beginner like me, the compose and create must be inside the loop. I had to do some test before succeed it.

     

    Pierre

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
Mohsin Ali Profile Picture

Mohsin Ali 430

#2
11manish Profile Picture

11manish 341 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 282

Last 30 days Overall leaderboard