cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
A-IT
Resolver I
Resolver I

Filter Query by File Name (Get files properties only)

I am trying to create a flow that will copy all files from one folder to other folders based on the file name. I was able to create the flow to copy all files in one folder to another single folder. Now I am trying to expand the usability by automatically sorting based on a portion of the file name.

Filter Query 2.png

I have my test files above. I want anything with '1A' in the name to be moved to Folder 1, '2B' moved to Folder 2, etc. I tried using an initializing variable and conditions, but it doesn't seem to be working since it's "Apply All". I am attempting to use the Query Filter for the file names highlighted in red.

Filter Query 1.png

I'm attempted the following ODOTA queries with no luck:
Name contains('1A')
Title contains('1A')
FileLeafRed contains ('1A')

I've also tried all the above with endswith. Any help of how to correctly write the query would be much appreciated. I would prefer a function like 'contains' so it will look anywhere in the file name for the characters I want. I believe if I can get this function working, I can alter it to other uses. Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

Try:

substringof('1A',FileLeafRef)

That should do what you need.

 

Please...

If I answered your question Accept it as a solution ✔️ 

If I helped you out, please give me some Kudos 👍

Thanks 😙

 

View solution in original post

2 REPLIES 2
Paulie78
Super User
Super User

Try:

substringof('1A',FileLeafRef)

That should do what you need.

 

Please...

If I answered your question Accept it as a solution ✔️ 

If I helped you out, please give me some Kudos 👍

Thanks 😙

 

@Paulie78 thank you! For my learning, when writing ODOTA, is it function first, then what you're querying, followed by which Cell you want to compare it to?

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (3,250)