cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cwallis123
Level: Power Up

Save email attachment to Dropbox and overwrite same file name each time

Hi All,

 

I'm relatively new to Flows but have struggled to get my head round this simple process...

 

When I receive a new email into Outlook from a specified sender, I want the email attachment to be saved to Dropbox as the same file name each time. Even if it overwrites an existing file with the same name i.e. I always want the attachment to save as TEST_FILE.xlsx

 

Im struggling to get flows to overwrite the TEST_FILE.xlsx name each time

 

Also how do you specify to Flows that it should save it as .xlsx?

 

Any help would be much appreciated thanks

 

 

1 REPLY 1
Community Support Team
Community Support Team

Re: Save email attachment to Dropbox and overwrite same file name each time

Hi @ cwallis123,

 

Could you please share a screenshot of the configuation of your flow?

Do you want to save the attachment of the email in the Dropbox and name the file as “TEST_FILE.xlsx” ?

What is the document type of the attachment? Would it always be a ".xlsx" file?

 

I have made a test on my side, if the attachment is a ".xlsx" file, you could refer to steps below to create the flow:

  1. Add a trigger “When a new email arrives”, fill in an email address in the “From” field, the “Has Attachment” field and the “Include Attachments” both choose “Yes”.
  2. Add action “List files in folder” of Dropbox connector, choose the file path that you want to save the attachment in the “Folder” field.
  3. Add an “Apply to each”, choose the “Body” dynamic content of the “List files in folder” in the input field.
  4. Add a Condition inside the “Apply to each”, the first value choose the “Name” dynamic content of the “List files in folder”, the second value fill in “TEST_FILE.xlsx”, the condition in the middle choose “is equal to”.
  5. Add a “delete file” action of the Dropbox connector in the If yes branch of the Condition, choose the “Id” dynamic content of the “List files in folder” in the file field.
  6. Under the “Apply to each”, add an “Apply to each 2”, choose the “Attachments” dynamic content of the trigger in the input field.
  7. Add a “Create file” inside the “Apply to each 2”,choose the “Content”dynamic content of the trigger in the “File Content”t field, choose the file path that you want to save the attachment in the “Folder path” field, the path should the same as the path of “Folder” field of action “List files in folder”.Fill in “TEST_FILE.xlsx” in the “File name” field.

1.png2.png

When an email is arrives with attachment and is sent by “Test2@XXXXXXXXXX.com” ,the flow would run successfully to save the attachment as “TEST_FILE.xlsx” in the dropbox, and if the path have already have a file that name is “TEST_FILE.xlsx”,the acttachment would overwrite the file.

 3.png

 

 

Regards,
Alice Zhang

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,169)