Announcements
Hi, is it possible to use "if" expression in Filter Query? I want to add another parameter in the filter if the value is not empty/blank.
I am trying to add a "if" condition but I cannot update as the expression is invalid.
Any advise?
Hey, @sbgoh , is there a chance that you could pull the IF statement out of the expression and into a Condition action to feed a variable, and just use the variable in the ODATA?
Hi, I tried to use filter array in if condition but the filtering is not working. Do you have any sample for your solution?
Sorry, I'm not really sure where the Filter Array is coming from, @sbgoh , mate ... but just do the calculation that you're doing in the expression with flow actions, and have the result of the condition (or switch) set the value of whatever you need in the ODATA.
Does that make more sense?
@sbgoh
You can't use an if() expression in the way you want in your filter.
Hi eliotcole,
I don't quite understand what you mean. My filters might be the following pt 1 & 2.
E.g.
1. If I want to get the records for "Customer = ABC" with "Stage = Pending".
2. If the user leaves Customer = Blank, and Status = Pending, it means to retrieve All customers with pending status.
I am able to do pt 1 alone but I don't know how to combine pt 1 & 2. Any advise?
Not sure if it will help in your case but I have managed something similar to what you are trying to do.At the beginning of my Flow I use the Initialize Variable (I would assume Compose may work as well) "if(contains(variables('InternalDomains'),variables('SenderDomain')),'Internal','External')"
Output would then be 'Internal' Or 'External'
In the ODATA query RecipientAddress eq '@{items('ForEachRecipient')}' and Internal_x002f_External eq '@{variables('InternalOrExternal')}'The x002f is just a forward slash in the column name
I construct my filter query at PowerApps and got my problem solved.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 233 Super User 2026 Season 2
David_MA 227 Super User 2026 Season 2
Mohsin Ali 178