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 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,228 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,228 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,228 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

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard