SAP Builders Discussions
Join the discussion -- ask questions and discuss how you and fellow SAP Builders are using SAP Build, SAP Build Apps, SAP Build Process Automation, and SAP Build Work Zone.
cancel
Showing results for 
Search instead for 
Did you mean: 

Struggling to Make Button Toggle in Build Apps

D_Gerding
Explorer
0 Kudos
569

Struggling to Make Button Toggle in Build Apps (community)

I'm trying to make an onboarding experience in an app I'm designing where the user may select multiple tags for themselves. While I can use a simple checkbox, I would like to instead use toggleable buttons that change color/visual state when selected, but I'm not sure how to do this. I am unable to find any variables or formulas where I can change the style of a button after it is tapped in the logic.

For reference, here is what the buttons look like when they are not toggled. 

Ideally, the rounded buttons with content in them would change to a blue background with white text after being selected.

Could someone please tell me the proper logic flow I need to accomplish this?

Dave Gerding (for student Sebastion S)

D_Gerding_0-1714583652703.jpeg

1 REPLY 1

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
510

Some of this depends on how you are implementing the buttons and container that holds them, but in principal you can easily change the color of a button "programmatically".

Here I created a checkbox with a button, and I created a page variable Dark, that is bound to the checkbox.

Dan_Wroblewski_1-1714748271989.png

For the color of the button I edit the style and select NEW PALETTE to create a new color, but I choose formula, and then provide a formula based on the page variable.

Dan_Wroblewski_0-1714748209594.png

So in the end if I click on the checkbox, the color changes. You can use this technique but without a checkbox.

2024-05-03_17-54-19.gif

 

 

 




--------------
See all my blogs and connect with me on Twitter / LinkedIn