web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / OData query invalid - ...
Power Automate
Unanswered

OData query invalid - and or

(0) ShareShare
ReportReport
Posted on by 289

Hi Guys,

I am trying to calculate who an approver should be in my approval flow.

If the current approval level is <= 3 I need to include Region in my filter, if the current approval level is > 3 I need to exclude Region in my filter. The following query is invalid. Is it possible to do what I am attempting in a single query?

JimJim_0-1622127879401.png

Here is the actual filter code

Title eq '@{outputs('Get_approval')?['body/BusinessUnit']}' and (Region eq '@{outputs('Get_approval')?['body/Region']}' or @{outputs('Get_approval')?['body/ApprovalLevel']} gt 3) and Approval_x0020_Level_x0020_Fleet eq @{outputs('Get_approval')?['body/ApprovalLevel']} and Max_x0020_Approval_x0020_Value_x gt @{outputs('Get_approval')?['body/TotalValueUSD']}

 

Categories:
I have the same question (0)
  • NiloferA Profile Picture
    on at

    Hello @JimJim ,

    You can try this, 

    Title eq '@{outputs('Get_approval')?['body/BusinessUnit']}' and ((Region eq '@{outputs('Get_approval')?['body/Region']}' and @{outputs('Get_approval')?['body/ApprovalLevel']} gt 3 and Approval_x0020_Level_x0020_Fleet eq @{outputs('Get_approval')?['body/ApprovalLevel']} and Max_x0020_Approval_x0020_Value_x gt @{outputs('Get_approval')?['body/TotalValueUSD']}) or (Approval_x0020_Level_x0020_Fleet eq @{outputs('Get_approval')?['body/ApprovalLevel']} and Max_x0020_Approval_x0020_Value_x gt @{outputs('Get_approval')?['body/TotalValueUSD']}))

    If you still get an invalid query error, try to check that you are enclosing all the text values in single quotes 'your value here'

    Please give a Kudo if you found this helpful or Accept this Reply as Solution if it solved your problem

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 103 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 87

#3
trice602 Profile Picture

trice602 63 Super User 2026 Season 1

Last 30 days Overall leaderboard