cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AJGilbey
Level: Powered On

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
Super User
Super User

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
Community Support Team
Community Support Team

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.
AJGilbey
Level: Powered On

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

Super User
Super User

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!


AJGilbey
Level: Powered On

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
Super User
Super User

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.

GetFilesProperty-1.JPGFlow ActivityGetFilesProperty-2.JPGDocument 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!


AJGilbey
Level: Powered On

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.

AJGilbey
Level: Powered On

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?

AJGilbey
Level: Powered On

Re: Filter OData in SharePoint Get Files action

An update - Indexed columns seem to work.

Super User
Super User

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 472 members 6,091 guests
Please welcome our newest community members: