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?
Have you considered using the overwrite option? How to overwrite files using the create file action in Power Automate – SharePoint Stuff
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
File identifier is items('Apply_to_each')?['{Identifier}']
Let me know if that works for you.
Craig
User | Count |
---|---|
89 | |
37 | |
26 | |
13 | |
12 |
User | Count |
---|---|
128 | |
53 | |
38 | |
26 | |
21 |