jae1202
jae1202

Reputation: 1

Can files be deleted in a folder if they don't contain a specific word using Power Automate?

I currently have a folder which has photos dumped into it, I am looking to delete all files that do not contain a specific word (which is present in all file names in which I want to keep).

I am hoping this can be done with power automate as there is 100's of photos and I want to improve its efficiency.

I look forward to learning from somebody!

Image below, it seems the flow ran successfully.

enter image description here

Upvotes: 0

Views: 1197

Answers (1)

Expiscornovus
Expiscornovus

Reputation: 1497

You could use a Get files (properties only) action and use a filter array afterwards. In the filter array you could check if the Name field does not contain your keyword.

After that you can loop through the results of the filter array and delete the files based on the {Identifier} field.

Below is an example of that approach
Test it properly, because you are deleting files. Otherwise restore from the first or second stage recycle bin ;)

enter image description here

Upvotes: 1

Related Questions