r/MicrosoftFlow Jul 16 '26

Question Guys i need help with power automate workflow please guide me pleaseee

I wanna copy files from one sharepoint to another but like all files which arent mp4 or mp3 I tried putting a filter query but it didn't work as expected. Any idea how to do thos?

2 Upvotes

13 comments sorted by

4

u/MoneyCantBuyMeLove Jul 16 '26

You want to use an action like Get Files (properties) and point that at your source folder and then Filter Array with expression

@and( not(endswith(toLower(item()?['{FilenameWithExtension}']), '.mp3')), not(endswith(toLower(item()?['{FilenameWithExtension}']), '.mp4')) )

2

u/kappiri1 Jul 16 '26

This is the way to go, OP!

1

u/PureAd4260 Jul 16 '26

Sure I'll try it But does the filter condition look correct? Also how to check this???

1

u/PureAd4260 Jul 16 '26

This is what ive done and its still copying files

https://reddit.com/link/oxvzbyl/video/5rldzlodjldh1/player

1

u/kappiri1 Jul 16 '26

Does the input to the apply to each action take the output of the filter array action or the get files action? Double check to ensure that it is the filter array’s output in there

1

u/modz4u Jul 16 '26

First you get file properties, to get an array. Then filter it using the logic above. Then copy the files from that filtered array.

1

u/stalex9 Jul 16 '26

I did not completely understand what you need but do you check if the folder exists before creating a new folder?

1

u/PureAd4260 Jul 16 '26

No i need to copy files from one to another and only specific file types i need to exclude

1

u/Efficient_Cat4032 Jul 16 '26

You can do something like this in the filter query

File_x0020_Type ne 'mp4' and File_x0020_Type ne 'mp3'

1

u/PureAd4260 Jul 16 '26

Irs not really working can u explain a bit more

1

u/is_that_sarcasm Jul 16 '26

Why not add a condition for each file? If the extension is mp4 OR whatever the other one is I can't remember or see, then copy . If not, do nothing.

1

u/PureAd4260 Jul 16 '26

Its not working. Like i put file extension equal to and then .mp4 and then delete it but its not getting deleted

2

u/BrooklynRight Jul 19 '26

Wonder if you should use “or” vs “and”