Skip to main content

Notifications

Power Automate - General Discussion
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']}

 

  • NiloferA Profile Picture
    NiloferA on at
    Re: OData query invalid - and or

    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,691

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 65,019

Leaderboard