cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Solution Sage
Solution Sage

Re: Filter OData in SharePoint Get Files action

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!

Proud to be a Flownaut!


View solution in original post

9 REPLIES 9
Highlighted
Community Support
Community Support

Re: Filter OData in SharePoint Get Files action

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.
Highlighted
Helper I
Helper I

Re: Filter OData in SharePoint Get Files action

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

Highlighted
Solution Sage
Solution Sage

Re: Filter OData in SharePoint Get Files action

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!

Proud to be a Flownaut!


Highlighted
Helper I
Helper I

Re: Filter OData in SharePoint Get Files action

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
Highlighted
Solution Sage
Solution Sage

Re: Filter OData in SharePoint Get Files action

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!

Proud to be a Flownaut!


Highlighted
Helper I
Helper I

Re: Filter OData in SharePoint Get Files action

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.

Highlighted
Helper I
Helper I

Re: Filter OData in SharePoint Get Files action

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?

Highlighted
Helper I
Helper I

Re: Filter OData in SharePoint Get Files action

An update - Indexed columns seem to work.

Highlighted
Solution Sage
Solution Sage

Re: Filter OData in SharePoint Get Files action

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!

Proud to be a Flownaut!


View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (9,296)