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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / IF statement with four...
Power Automate
Unanswered

IF statement with four conditions

(0) ShareShare
ReportReport
Posted on by 15

I am wanting to score information entered on a form.  The data is stored in SPO.  I have created and successfully tested for two conditions but I to use this for 4 conditions.

 

Working 2 conditions:

 

if(or(equals(outputs('Create_item')?['body/field_6'], '1000'),equals(outputs('Create_item')?['body/field_6'], '25000')),'2','3')

 

Invalid Statement:

 

if(or(equals(outputs('Create_item')?['body/field_6'], '0 - 999'),(equals(outputs('Create_item')?['body/field_6'], '1000'),(equals(outputs('Create_item')?['body/field_6'], '25000'),equals(outputs('Create_item')?['body/field_6'], '25000 +')),'0','1','2','3')))

 

Can I only use 2 conditions, i.e. true or false?

Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Hi @MBlaired79 ,

     

    One option is to use the Switch option:

     

    Snag_b822dcd.png

    Snag_b85df8a.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

  • MBlaired79 Profile Picture
    15 on at

    Thanks for this.  I did consider this as an option but I have 25 questions to score and I wanted a quick solution 🙂

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Hi @MBlaired79 ,

     

    Another option is to use a JSON object to store your "key" and their associated values:

    Snag_b8d8732.png

    {
     "1000": "1",
     "25000": "2",
     "0 - 999": "0",
     "25000 +": "3"
    }

    Then using an expression, you could "lookup" the key value and return its associated value

    Snag_b8e8a98.png

    variables('varRange')?[outputs('Create_item')?['body/field_6']]
     
    So, if field_6' contained "25000", the expression should return the value "2".
     

    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site
     
     
  • MBlaired79 Profile Picture
    15 on at

    I love this but I've hit an error

     

    Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language expression 'variables('VarRange_UsersImpacted')?[outputs('Create_item')?['body/field_6']]' cannot be evaluated because property '25000' cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'.

     

    Config below

  • Verified answer
    Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Hi @MBlaired79 

     

    The error is due to the second part of your expression referencing a SharePoint column (field_6) that does not exist? 

     

    Snag_bc07279.png
    Can you use the source column/value from the form. In my demo flow I'm using the following:
     
    Snag_bcade23.png

    Field_6 may not be the correct name of the SharePoint column. Please see : 🔍How to Find the Internal Name of a SharePoint Column – Ellis Karim's Blog

    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site
  • MBlaired79 Profile Picture
    15 on at

    Perfect, thank you.  All working!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard