cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
misiek5510
Regular Visitor

Deleting Attachment prior to saving new

Hi,

 

I have few basic flows that save my email attachments into sharepoint folders for Power BI to generate reports. However I still have to delete old file manually. The problem is each folder contains previous years data which I want to keep and only delete this years data (updated daily). I have put DO NOT DELETE in the previous years files name, so the flow knows not to delete anything with that phrase. Ideal scenario would be that when email comes in it triggers deletion of any file does not contain DO NOT DELETE in the file name and then save new attachment that just came through. Can this be done?

2 REPLIES 2
lbendlin
Super User
Super User

CraigStewart
Super User
Super User

This should delete all files without DO NOT DELETE in the name

 

In Get files you can use the filter query

FSObjType eq 0

to ignore folders

 

CraigStewart_2-1664622501868.png

File identifier is items('Apply_to_each')?['{Identifier}'] 

 

Let me know if that works for you.

 

Craig

 

 

Helpful resources

Top Solution Authors
Users online (3,626)