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 Office 365 email ...
Power Automate
Unanswered

Save Office 365 email attachments to OneDrive for Business

(0) ShareShare
ReportReport
Posted on by 4

hello

 

i use this flow " Save Office 365 email attachments to OneDrive for Business" to automatically download the attachments of incoming emails, but the files I download have the same name. i have saved four but have not kept saving the others

 

wait for answer

 

thanks for advance 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,300 Most Valuable Professional on at

    I looked at the template.  The files should retain whatever name they had as attachments.  Are you saying all downloaded files have the same name?  or that the names are the same as the name of the attachment?  If its the later that's the way its designed to work.  Can you provide more detail on exactly what your problem is?

  • schavas28 Profile Picture
    2 on at

    Hello Community

     

    I'm running the same  issue as above as I've been having some issues with one of my flows trying to save email attachments (in my case are excel files) that are named the same way.

    See below the names of the files I'm currently having issues with:

    CBK_ADHOC_RESUBMISSION_STATUS_RPT_GR.CSV

    CBK_ADHOC_RESUBMISSION_STATUS_RPT_PF.CSV

     

    So for instance, let's say today I received some emails with their attachments (excel files under those names) they will be saved in the folder I created in One Drive, but if I received tomorrow or another day some attachments with the same name, they will replace the ones that are in the folder, which is not the case because each excel file contains different information. My desire to fix this issue is to save all the attachments (excel files under the same name but different information)in the same One Drive folder no matter they share the same name.

     

    Hope you can help me ASAP.

     

    Thanks

  • Pstork1 Profile Picture
    69,300 Most Valuable Professional on at

    If you save files with the same name overtop each other then yes, they will overwrite the existing file.  The same thing happens if you just upload the file to OneDrive.  You can't save more than one file using the same name.  Its just not possible in OneDrive.  You need to add something to the filename when you create the file in the Flow to differentiate it from the one that is already there.

  • dyeregui Profile Picture
    4 on at

    hello Pstork1

     

    How do I make the file save a different name and prevent the file from being replaced?

     

    thanks for advance

  • Pstork1 Profile Picture
    69,300 Most Valuable Professional on at

    In the action where you create the file in OneDrive make sure that the filename field has a unique file name instead of just re-using the same file name.  One way to do that would be to strip off the extension and then concatenate text to the end based on the date and time.  Make sure you also replace the file extension after adding the extra text.

  • dyeregui Profile Picture
    4 on at

    hello sir,

     

    try putting this expression of adding seconds in the part of creating file but it doesn't work, as it should be?

    dyeregui_0-1621967413804.png

    thanks for advance!!

     

  • Pstork1 Profile Picture
    69,300 Most Valuable Professional on at

    Add seconds creates a date value, which you can't use as a filename.  I was suggesting something more like this. Which will append a unique number based on today's date to the end of the filename .

    concat(outputs('Get_file_metadata')?['body/NameNoExt'],formatDateTime(utcNow(),'yyyymmdd'),'.doc')

     

     

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 589

#2
Valantis Profile Picture

Valantis 459

#3
11manish Profile Picture

11manish 382

Last 30 days Overall leaderboard