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 / Problems with AND/ OR ...
Power Automate
Unanswered

Problems with AND/ OR settings in Condition function

(0) ShareShare
ReportReport
Posted on by 52

Hi

 

Hoping someone maybe able to help me as I'm fairly new to Power automate.

 

I'm trying to set up a fairly simple purchase request approval flow using Microsoft forms and Power Automate.  I have created a simple form which collects data including the total value of the spend and the type of spend.

 

I want a condition which sends an approval to our IT manager if the total value of spend is £0-£5k and is either for IT Equipment or Software.

 

I have attached a screenshot for the condition I have currently set.  This works where the spend is £0-£5k and is for IT equipment but doesn't work where the spend is £0-£5k and Software.  

 

It feels like the 'OR' bit in the condition is where this is failing.

 

I'd really appreciate any help if anyone has some expertise.

 

Thanks

 

HigDave_1-1708960705290.png

 

Categories:
  • Bruno_CR Profile Picture
    16 on at

    Hi @HigDave 

    Here’s how you can modify your condition:

     

    • Condition Logic:

    You want to trigger an approval if the total value of spend is between £0 and £5k and if the type of spend is either IT Equipment or Software.

    We’ll use the following logical expression:

    If (Total Value of Spend >= £0 AND Total Value of Spend <= £5k) AND (Type of Spend = "IT Equipment" OR Type of Spend = "Software")

     

    • Refined Condition:

    In your screenshot, you’ve set up the condition as follows:

     

    Total Value of Spend is greater than or equal to 0 AND Total Value of Spend is less than or equal to 5000 AND Type of Spend is equal to "IT Equipment"

     

    To include software requests, modify the condition as follows:

     

    Total Value of Spend is greater than or equal to 0 AND Total Value of Spend is less than or equal to 5000 AND (Type of Spend is equal to "IT Equipment" OR Type of Spend is equal to "Software")

     

    Remember to replace the placeholders (e.g., “Total Value of Spend” and “Type of Spend”) with the actual field names from your form. Additionally, ensure that the field values are consistent (e.g., “IT Equipment” and “Software”) to match your form responses.

  • HigDave Profile Picture
    52 on at

    Thanks very much for your response.

     

    I think my workflow is slightly more simple than how you've interpreted it.  The total spend from the Form isn't a numerical value but a text choice list based on the different thresholds (see screenshot).

     

    HigDave_0-1708968842685.png

     

    Therefore the workflow doesn't need to include logic around whether the number is greater than or less than values, rather is it "£0k-£5k" selected.

     

    My workflow is pulling in actual fields and I've looked at the coded logic (extract below) and it appears to make sense.  So I'm still a little puzzled?

     

    {
      "type": "If",
      "description": "",
      "expression": {
        "and": [
          {
            "equals": [
              "@body('Get_response_details')?['rbe27258ab4c24dc990a6d675ac2929de']",
              "£0k-£5k"
            ]
          },
          {
            "contains": [
              "@body('Get_response_details')?['r13a3b00b95fd4d27bebb0601b2f6e38b']",
              "IT Equipment"
            ]
          },
          {
            "or": [
              {
                "contains": [
                  "@body('Get_response_details')?['r13a3b00b95fd4d27bebb0601b2f6e38b']",
                  "Software"
                ]
              },
              {
                "equals": [
                  "@body('Get_response_details')?['rbe27258ab4c24dc990a6d675ac2929de']",
                  "£0k-£5k"
                ]
              }
            ]
          }
        ]
      },

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 377

#2
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 130

Last 30 days Overall leaderboard