Power Automate SharePoint Get items filter query contains is not valid

In this Power Automate tutorial, we will discuss, how to use contains filter query in Power Automate Get items flow action. We will also see, how to fix the error, Power Automate SharePoint Get items filter query contains is not valid. The error also looks like, Action ‘Get_items’ failed in Power Automate flow or Microsoft flow.

The expression Title contains is not valid. Creating query failed in Power Automate

Recently, I got a requirement to move items from a SharePoint list to another list based on a filter condition using Power Automate. It should move the items whose title contains a specified string else it should not move the item.

Here we have two SharePoint lists i.e. DemaoPostgreSQL (the Source list) and another one is PostgreSQLTask(the destination list). It will move the items from one list to another if the title field contains a specific string i.e. Postgresql.

So we had used the ODATA filter expression in Power Automate Get_items filter query to get the filtered item that contains Postgresql:

Title contains 'Postgresql'

But when we ran the flow, we got the error details like below:

Action ‘Get_items’ failed

The expression “Title contains ‘Postgresql'” is not valid. Creating query failed.
clientRequestId: 3552ffb3-2756-4ea3-886f-e5e5fc3ebe91
serviceRequestId: 3552ffb3-2756-4ea3-886f-e5e5fc3ebe91

Power Automate action Get_items failed
Power Automate action Get_items failed

After some research, we got to know that the Get_items does not support Contains in the filter query, so it shows the expression is not valid.

See also  How to Convert XML to SharePoint List using Power Automate?

So to fix the error, follow the below steps.

How to use contains in Get items filter query in Power Automate

Since we can not use the Contains option in the Get items filter query in Power Automate, we will get all the items from the SharePoint list and then we will add a filter in a condition flow action.

The idea here is to use the filter based on the Title column inside the condition.

For this, here we will use a condition action after the Get_items that will filter the item that contains ‘postgreSQL’ on the title field.

In condition, we will use the Title from the Get-items action. Also, we will use the OR operator to search different formats of the string i.e. PostgreSQL / Postgresql / PostgreSQL.

Like Title contains PostgreSQL etc. Check the condition below:

Power Automate SharePoint Get items filter query contains
Power Automate SharePoint Get items filter query contains

If the condition will satisfy then it will create the filter items in the destination list and delete that item from the source list. So we will add an action inside the If yes section:

Power Automate SharePoint Get items filter query contains
Get items query failed in Power Automate

This is how the final flow looks like:

Power Automate ODATA contains expression failed
Power Automate ODATA contains expression failed

Now we will test this flow to see how it works. For this, in the Source list, we have inserted some data like:

Power Automate Get items action failed
Power Automate Get items action failed

After running the flow, we can see the specified items got moved to the destination list i.e. PostgreSQLTask

Power Automate get items ODATA contains query invalid
Power Automate get items ODATA contains query invalid

Also, these selected items got deleted from the source list:

Get Items OData filter contains is invalid
Get Items OData filter contains is invalid

You may like the following Power Automate tutorials:

See also  Power Automate shared mailbox

This is how we can fix the error when the action ‘Get_items’ ODATA filter contains is invalid in Power Automate. This is how to use the contains option in Power automate Get items filter query.

>