4 most common problems with Filter Query in Power Automate

“My Filter Query in Power Automate action ‘Get files’ doesn’t filter any data. It returns all documents all the time.”

“The ‘Get items’ filter in Power Automate doesn’t return any items. But I know there are a few in the list”

“Why do I get BadRequest error?”

When your Filter Query in the the Power Automate actions Get items or Get files doesn’t return the data you expect, you might have one of the problems I see very often.

1. Not using column internal name in the query.

Every column in SharePoint has 2 names, internal name (in url format, assigned when the column is created, non-changeable) and display name (the column name you see, can be changed). The most common case of misalignment of internal and display name is when you create a column with spaces in name, e.g. ‘New column’, its default internal name could be ‘Newcolumn’ or ‘New_x0020_column’. So instead of using New column eq 'Something' you have to use Newcolumn eq 'Something' or New_x0020_column eq 'Something‘.

Another case of misalignment happens when you or one of your colleagues rename a column. That’s why the columns have an internal name, otherwise you’d need to change all your solutions every-time you change column name.

How do you find the internal name to use? The easiest way is to go to list settings -> edit column and take it from the url there, it’s the part after ‘Field=’:

2. Syntax of the filter query is not correct.

When using a column in the filter, you use just the internal name as it is. Plain text = SharePoint column internal name.

The value you’re comparing with must be always inside single quotation marks, e.g. column eq 'value'. It is quite common to forget the closing one that will lead to an error.

Also, it’s possible only to compare a column with a ‘value’ in the filter, you can’t do a comparison between two columns like column1 eq column2.

3. Filter based on a column that is not supported.

There’re a few columns that are not supported for the use in the filter, among them are multiple lines of text, lookup and calculated columns.

Additionally to these, there are also some system columns you can’t use, the most famous one being Name of a file in a document library. You can recognize these columns when you try to use them in one of the actions, on hover they’ll be displayed inside { } brackets, as you can see on this example for the document Name:

Hint: you can use FileLeafRef instead of Name (which you can’t use anyway), it contains the file name incl. extension, e.g. to filter only specific document type.

4. Column doesn’t contain the value you expect.

This applies above all when using date columns in the filter. Are you comparing just year/month/date values or does the column also include time?

To confirm what values are evaluated in the filter, you can store the values into variables in a similar way as when validating a condition.

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Add a Comment

Your email address will not be published. Required fields are marked *