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 Conditions
Power Apps
Answered

Multiple Conditions

(0) ShareShare
ReportReport
Posted on by 68

Hello,

 

Might be a silly question, but my goal here is to fill a dot based on what choice is in datacard.

Idea is : orange = if pending, green = if approved, red = if declined.

 

Somehow I cant make it work. 

 

Capture.PNG

Categories:
I have the same question (0)
  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Heya, I think you just have an extra comma at the end of your formula after the last White, remove that comma and it should work 🙂

     

    Actually, I think you can remove all of those White values except the last one, like this:

     

    If(
     DataCardValue49.Selected.Value = "Pending", Orange,
     DataCardValue49.Selected.Value = "Approved", Green,
     DataCardValue49.Selected.Value = "Declined", Red,
     White
    )
  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Hi,

     

    Try this:

    If(
        DataCardValue49.Selected.Value = "Pending", Orange,
        If(
            DataCardValue49.Selected.Value = "Approved", Green,
            Red    
        )
    )
  • Verified answer
    Mink21 Profile Picture
    158 on at

    As @iAm_ManCat said, you have an extra comma threre at the end.

     

    You could also use a Switch in this case:
    Switch(DataCardValue49.Selected.Value, "Pending", Orange, "Approved", Green,"Declined",Red,White)

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Hi @iAm_ManCat ,

     

    Are you confident in using this "simplified" if statement? I still use nested IFs.

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Yes absolutely - this isn't a simplified statement, its how If's are meant to be used:

     

    If(
     logic1, answer1,
     //else if 
     logic2, answer2,
     //else if 
     logic3, answer3,
     //else
     answer4
    )

     

     

    The nested if is actually less performant and can lead to performance impacts in larger nested ifs.

  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    This is why love the community, learning opportunities are just around the corner. Thanks @iAm_ManCat 

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Totally agree and glad to help!

    #SharingIsCaring

  • Veronika_Kys123 Profile Picture
    68 on at

    Hello all,

     

    Sorry I had a day off on Friday. Unfortunately non of these are working. 😞 Using IF or SWITCH the color is returning white even when selected...

    Veronika_Kys123_0-1655711763425.png

     

  • Veronika_Kys123 Profile Picture
    68 on at

    Ah.. never mind! Added new Valuecard with 3rd approval and the two previous dots started working.. 😄 

     

    So both IF and Switch are working! Thank you so much! You saved me! 🙂 

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 431

#2
WarrenBelz Profile Picture

WarrenBelz 360 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 280 Super User 2026 Season 1

Last 30 days Overall leaderboard