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 / 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

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard