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 / Button to be used as a...
Power Apps
Answered

Button to be used as a Toggle Control

(0) ShareShare
ReportReport
Posted on by 19

I have designed a Button with Icon and instead use it as a Toggle Control.

 

By Default The button Colour(Fill) should be RGBA(0, 62, 169, 1)

 

So when i click the Button(On_Select), it should change the Colour to RGBA(202, 202, 202, 1) and set varTouch = "No"

If i click the Button again, it should revert the colour to RGBA(0, 62, 169, 1) and set varTouch = "Yes"

 

Im kinda lost how can i put my code to make my button act as a toggle?

 

Appreciate any guidance on this. 

Categories:
I have the same question (0)
  • Verified answer
    cha_cha Profile Picture
    4,932 Moderator on at

    Hello @SGP_SGR 

     

    Here's the easy way. Will send shortly the longer way.

     

    Use Boolean type variable so you can make it like true or false.

    cha_cha_0-1671269807576.png

    Then do this code in the Fill Property, interchange the color if I put it wrong.

    If(varTouch, RGBA(0, 62, 169, 1) , RGBA(202, 202, 202, 1))

    cha_cha_1-1671269869227.png

     

  • cha_cha Profile Picture
    4,932 Moderator on at

    Hello @SGP_SGR 

     

    And the longer code is:

    Set(varTouch,If(varTouch="yes","no","yes"))

    cha_cha_2-1671270037738.png

     

    And the Fill code:

    If(varTouch="yes", RGBA(0, 62, 169, 1) , RGBA(202, 202, 202, 1))

    cha_cha_3-1671270076312.png

     


      ✔️
    Just in case my response helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

     

      🔗
    🕸bistek.space  🐦 @cha_bistek  📺 @BisTekSpace 

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 413

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
timl Profile Picture

timl 315 Super User 2026 Season 1

Last 30 days Overall leaderboard