cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AJGilbey
Helper I
Helper I

Filter OData in SharePoint Get Files action

Has anyone had any success using the Filter Odata functionality in the Sharepoint Get Files (properties only) action? I can only get it to work for basic equals comparisons. Anything using greater than, or less than produces a Bad Gaetway error. 

 

I have also found that any attempts to do string comparisons, such as startsWith are invalid.

 

It appears that the functionality works in the SharePoint Get Items actions, but not the Get Files.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @AJGilbey,

 

Thanks for the info on you tests. I set up the library to contain more than 5k items in it, and tried the flow with and without an indexed column. I can confirm that the flow will fail with more than 5k items if the column used in the Filter Query is not indexed. I then tried it after indexing the column and the flow worked just fine.

When you can, please select a solution in this thread in the event other folks run into the same thing we did so they can see a solution.

 

Thanks,

Fausto Capellan, Jr

 

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

9 REPLIES 9
v-yamao-msft
Community Support
Community Support

Hi AJGilbey,

 

I assume that this doc could be your reference, please check it at here:
https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-odata-query-operations-in-sharepoint-...

 

I have tested the Odata filter for the action “SharePoint – Get files(properties only)” with the action eq, gt, and startswith, they are all working for me


The following screenshot are the functions I tested:
3.PNG

4.PNG

5.PNG

 

What’s the function you are using on your side?


Please try again with it.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Mabel,

 

Here is what I get when I attempt the same action as you. Does it make a difference that the documents are located in an Office 365 Group site?

flowFilterError.PNG

 

 

Regards

 

Adam

Hi @AJGilbey,

 

I tried the suggestions made by @v-yamao-msft and it worked for me. Not sure why it wouldn't work for you.GetFilesProperty.JPG

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!
AJGilbey
Helper I
Helper I

Thanks.

Did you try it on a document library housed in the site of an Office 365 group? Did it work for custom columns? I have been able to get the odata filter to work as designed for the Title column in our SharePoint instance but not for custom, especially multiple word named, columns in our Office 365 Group sites.

Regards

Hi @AJGilbey,

 

My previous test was on a regular Document library inside a SharePoint site, not an Office 365 Group site, but I just performed some tests on a Document library inside an Office 365 Group site and it worked fine. I added two columns with multiple words as you mentioned, and Flow was able to retrieve the files based on the specific filter I applied. I used the same "startswith" filter query on multi word column and it worked. The screenshots below have the Document library structure and the results from the Flow activity. FYI, I am starting this flow manually since I didn't see any indications of the flow using a different trigger.

Flow ActivityFlow ActivityDocument LibraryDocument Library

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Thanks @faustocapellanj@v-yamao-msft,

 

At least I have confidence that the issue is isolated to my environment. I will continue to run tests to try and identify the particular cause.

Hi,

 

Further testing has revealed that the issues occur only in Document libraries that have over the 5,000 document threshold - even when using Indexed columns for the filter.

 

@faustocapellanj, are you able to test this theory?

An update - Indexed columns seem to work.

Hi @AJGilbey,

 

Thanks for the info on you tests. I set up the library to contain more than 5k items in it, and tried the flow with and without an indexed column. I can confirm that the flow will fail with more than 5k items if the column used in the Filter Query is not indexed. I then tried it after indexing the column and the flow worked just fine.

When you can, please select a solution in this thread in the event other folks run into the same thing we did so they can see a solution.

 

Thanks,

Fausto Capellan, Jr

 

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (73,960)