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 Apps / Multiple IF statements
Power Apps
Answered

Multiple IF statements

(0) ShareShare
ReportReport
Posted on by 75

When I only enter 2 conditions it works, but when I enter 3 conditions it doesn't work. Can someone please help me with the syntax. 

 

juliowastaken_0-1711748576474.png

 

 

 

Categories:
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    YOu are missing a comma in front of the true.

    if(dpSelectStudy.selected.value = "something" | dpSelectStudy.selected.value = "something" | dpSelectStudy.selected.value = "something" , true, false)
  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @juliowastaken - you're missing a comma.

     

    If(
     dpSPSelectStudy.Selected.Value = "ASPIRE" || dpSPSelectStudy.Selected.Value = "DETECT" || dpSPSelectStudy.Selected.Value = "SOFAST",
     true,
     false
    )

     

    On a related note, depending on what you're trying to do, you do not need to wrap an IF function around a formula which is already going to return a boolean anyway. For example, the below will return the same output:

     

    dpSPSelectStudy.Selected.Value = "ASPIRE" || dpSPSelectStudy.Selected.Value = "DETECT" || dpSPSelectStudy.Selected.Value = "SOFAST"

     

    As will this:

     

    dpSPSelectStudy.Selected.Value in [
     "ASPIRE",
     "DETECT",
     "SOFAST"
    ]

     

  • juliowastaken Profile Picture
    75 on at

    it worked, thank you for your help. 🙏

  • alexsolexToo Profile Picture
    37 on at

    and consider using Or(...) and And(...) as soon as you have several conditions to check : your code will be more readable.

    Or(
     dpSPSelectStudy.Selected.Value = "ASPIRE",
     dpSPSelectStudy.Selected.Value = "DETECT",
     dpSPSelectStudy.Selected.Value = "SOFAST"
    )

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 Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard