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 / Issue with Conditional...
Power Apps
Answered

Issue with Conditional Formatting in Power Apps

(0) ShareShare
ReportReport
Posted on by 4

Hello everyone,

 

I've been trying to implement a simple conditional color change in Power Apps using the following code:
If(Slider1.Value > 50, Green, Red)

However, it doesn't seem to be working as expected. Even simplified code snippets like this often do not produce the desired result without any apparent reason.

 



Categories:
I have the same question (0)
  • Ramspevi Profile Picture
    110 on at

    Hello @LeChef60 ,

    please consider the following: 


    1. The condition Slider1.Value > 50 will be false for values under or equal 50 and if the slider value is empty or not yet fully loaded.
    2. I wouldn't reference colors with just there name. PowerApps sometimes bugs out if you do this. Try Color.Green / Color.Red instead.

     

    For more support I would need additional context or screenshots.

    Hope this helps

  • LeChef60 Profile Picture
    4 on at

    Thank you for your response.
    I have included screenshots so that you can understand what I wanted to do.

    Initially, I wanted to change the color of an icon using 3 sliders, and it worked. Now, the next step is to either change the color with just 1 slider or modify the visibility of the icon with a single slider

    Annotation 2023-10-20 105934.png
    Annotation 2023-10-20 110915.png
    Annotation 2023-10-20 105720.png
  • Verified answer
    Ramspevi Profile Picture
    110 on at

    Thanks for the screenshots. 

    Lucky you! The solution is quite simple. 

    Ramspevi_0-1697830085098.png

    Replace the commas with semicolons 😉

    If(Slider1.Value <= 50; RGBA(255; 0; 0; 1); RGBA(0; 255; 0; 1))

     

    Please consider marking my answer as solution if your problem is solved. 😊

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard