Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Change Icon Colour based on Value

(0) ShareShare
ReportReport
Posted on by 181

I need to the 'Tick' Icon on power apps Green, from its native Blue when the Value of the Status box is 'Complete' 

 

I currently have 4x options in my Status box:

 

Pending

Submit

Action Required

Complete

 

I have the Visibility of this icon set to true if values 'Submit' or 'Complete' are selected using the following:

 

If(ThisItem.Status.Value="Submit" Or "Complete",true,false)

 

However, I'm struggling to get the icon to change colour depending on which of the two values is selected, so need help with the following:

 

If Status Value = "Submit", colour should be RGBA(0, 18, 107, 1)

If Status Vale = "Complete" Colour should be RGBA(99, 139, 44, 1)

 

Many thanks

Categories:
  • Angry_Sys_Admin Profile Picture
    181 on at
    Re: Change Icon Colour based on Value

    @RandyHayes This has worked thank you

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: Change Icon Colour based on Value

    @Angry_Sys_Admin 

    You have an extra comma in your formula.

    Should be:

    Switch(
     ThisItem.Status.Value,
     "Complete", RGBA(99, 139, 44, 1), 
     "Submit", RGBA(0, 18, 107, 1)
    )

     

    Your Visible property is not correct either.  It should be:

    ThisItem.Status.Value = "Submit" Or ThisItem.Status.Value = "Complete"

    Beyond that, you don't need the redundant If/true/false part...the above already returns a true or false.

     

    I hope this is helpful for you.

  • Angry_Sys_Admin Profile Picture
    181 on at
    Re: Change Icon Colour based on Value

    @Raksh1Wadel I had a look at this thread before posting, 

     

    I added a label with ThisItem.Status.Value  to check I was getting the correct result and it retunred the correct and expected result.

     

    However I am unable to get the Switch to work, this is what I have:

     

    Switch(
     ThisItem.Status.Value,
     "Complete", RGBA(99, 139, 44, 1), 
     "Submit", RGBA(0, 18, 107, 1), 
    )

     

    Angry_Sys_Admin_0-1665064651868.png

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Change Icon Colour based on Value

    Hi @Angry_Sys_Admin 

     

    refer to this link it will help you to resolve your issue.

    Solved: Change Icon color based on a choice value - Power Platform Community (microsoft.com)

     

    If this post helps, then please consider Accept it as the solution to help the others and consider giving it a "Thumbs Up."

    Solved: Change Icon Color based on Number Value (Simple!) - Power Platform Community (microsoft.com)

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,601 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,942 Most Valuable Professional

Leaderboard