Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

How to save an email attachement (excel file) in a sharepoint folder after having deleted all existing files in this folder ?



I have just discovered the potential of Power Automate, but I have never used it before. So I'm really a beginner and I'm not sure to understand yet all the logical applied in this tool. 


I would like to save in a sharepoint folder an excel file that I receive everyday attached to an email (always from the same list of people). I need to have just one file in this folder, which is the last received. The name of the file changes everyday because it contents the date of the day. So it means, that I want to delete all others files in this folder. 


Someone here to explain me how to do this magic ?


Thank yo ufor your help !






Hi @seb_ke 


You can use the following steps: 

1. Trigger -  When an email arrives (ensure that you flag the include attachments and has attachments to yes and add a subjec filter so that it picks up those emails only)

2. List folder from SharePoint (select the folder created for the files)

3. Apply to each item returned from previous step and add action to delete the files. 

4. Add action to create file in sharepoint and provide the necessary parameters. (note that this will result in an apply to each loop again but as long as there are no images or other attachments in the email, it should be fine)


Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,249)