cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
xyvic Helper I
Helper I

Change Toggle Based On Buttons Pressed

Hello, I have two buttons and a toggle on my app. The two buttons when pressed will trigger a flow based on the button pressed. The values of my buttons are true and false respectively. When I press the true button, I want the toggle to turn on and if I press the false button then turn off. How would I do this? And will the toggle value always stay or will it always go back to the default value whenever the app is started? 

1 ACCEPTED SOLUTION

Accepted Solutions
SKH19 Impactful Individual
Impactful Individual

Re: Change Toggle Based On Buttons Pressed

Hi @xyvic 

 

Set a variable when one of the buttons is selected and then set the visible property to the variable you set.

So on the buttons:

Set(varToggle, true)

Set(varToggle, false)

and on the toggle

varToggle

 

I had a similar app, where after the customer wanted the selection to persist. So I created a column in my datasource (which was CDS) to store a value and had the buttons Patch that value instead of storing a variable. Then the item I wanted to be visible called the value that was stored, which persisted.

 

---
Please hit the "Accept as Solution" button if my post answered your question! If my post was helpful please consider giving it a "Thumbs Up."

View solution in original post

1 REPLY 1
SKH19 Impactful Individual
Impactful Individual

Re: Change Toggle Based On Buttons Pressed

Hi @xyvic 

 

Set a variable when one of the buttons is selected and then set the visible property to the variable you set.

So on the buttons:

Set(varToggle, true)

Set(varToggle, false)

and on the toggle

varToggle

 

I had a similar app, where after the customer wanted the selection to persist. So I created a column in my datasource (which was CDS) to store a value and had the buttons Patch that value instead of storing a variable. Then the item I wanted to be visible called the value that was stored, which persisted.

 

---
Please hit the "Accept as Solution" button if my post answered your question! If my post was helpful please consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (7,384)