Hi @MsKautha
It is possible to apply an if statement inside an odata query, but I would be tempted to create the odata query on a step before just to make the flow more readable. But in any case, this code would do what you want, either in the odata query or outside of it.:
if(and(equals(empty(variables('variable1')), true), equals(empty(variables('variable2')), true)), 'Both Empty',
if(and(equals(empty(variables('variable1')), false), equals(empty(variables('variable2')), false)), 'Neither Empty',
if(equals(empty(variables('variable1')), false), 'variable1 has data', 'variable2 has data'
)
)
)
You could put that directly into your odata query and edit it to put your query where it output 'Both Empty', 'Neither Empty', etc.
But if it were me I would put it in a compose action on the step before with a comment. Then add a switch control after based on the output of the compose to put the odata query in a string variable, and then just add that string into your query from the dynamic content.
I just built a flow as described above and it worked fine.