cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
umangsr
Regular Visitor

Filter Query with multiple filters for Flow

Hi. I am trying to get filtered data from my table in PowerAutomate using Filter Odata query but I am unable to use the OR function to get multiple filters. I am able to use each function independently but if it does not work if I try to get an output using the OR function. Can someone please advise how to use it correctly.

 

These functions work independently (Here 'City' and "CompanyName' are the fields that are inputs and City & CompanyName are from the table)

 

contains(City,'City')

contains(CompanyName,"CompanyName')

 

but if I try to combine it using OR function as below, it does not work in either of these 2 options that I try

 

OR(contains(City,'City'),contains(CompanyName,"CompanyName'))

contains(City,'City') OR contains(CompanyName,"CompanyName')

 

Will appreciate if someone can suggest a solution. Basically, I want to use multiple filters to get the relevant data from a table before processing it

9 REPLIES 9
yashkamdar
Solution Sage
Solution Sage

Hello Team,

 

I think you are trying to complicate this, you can simply use an OR'ing like this in OData filter query -

 

City eq 'City' Or CompanyName eq  'CompanyName'

 

Here 'City' and 'CompanyName' are dynamic contents.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi @umangsr 

 

Can you share more details on the data source? If you are using excel, note that this connector has a limitation and can have only one 'eq', 'ne', 'contains', 'startswith' or 'endswith' operation. (source)

 

One work around for this could be to use one of the columns to filter in the OData itself and then use a condition in Power Automate for the other one. 

 

You could also try using the filter array action for this. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi @yashkamdar . Thanks for your response. Unfortunately, the OR function is not working in either way you have suggested. 

Hi @yashag2255 Thanks for your response. I am using Excel so that could be the reason I am not able to use more than 1 operator. 

 

Can you elaborate more on the solution that you have suggested about using the columns for filtering.

 

On Filter array, I am very new to PowerAutomate, so don't have complete knowledge how to use it. If you can share some links for the same, will appreciate. 

@umangsr 

 

Hey Mate, 

 

Excel has always been stubborn,  So I user Filter array action and then pass Multiple condition(It always works for me)...

 

 

@or(equals(item()?['Country'], 'US'),equals(item()?['Count'], '3'))

 

 

Untitled.png

 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

Evbelda
Helper I
Helper I

Hi,

 

The problem is with contains and excel:

City eq 'City' Or CompanyName eq 'CompanyName' it works

City eq 'City' Or  contains(CompanyName, 'CompanyName') it doesn't work

contains(City,'City') Or  contains(CompanyName, 'CompanyName') it doesn't work

why with multiple choices with contains it doen't work?

 

Kamacete
Helper III
Helper III

Hi,

I'm trying to apply more than one option on the filter, but without success.

this is what I have.

 

1.png

 

I will have to apply another filter for another column, can some one help me it this?

thank you in advance

Rui

Evbelda
Helper I
Helper I

Finally I found a solution when using filter query. Manualy you should put in the filter Array block:

(I understand that you are trying to filter contains "Info requested" OR "LT requested" in the filter:

 

@OR(Contains(Status, 'Info resquested'),Contains(Status,'LT resquested'))

Kamacete
Helper III
Helper III

Thank you evbelda

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,425)