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

How to reset a toggle ?

I had two ways to reset a toggle working yesterday which are not working anymore today:

 

First one: reset(DataCardValue) 

Second one:

 - on visible screen I create a variable updatecontext({resetToggle: false})

 - on the toggle I put resetToggle into the reset field

 - when I want to fire the reset, I updatecontext({resetToggle: true})

 

Do you have a third method which might work for more than one day ?

3 REPLIES 3
eka24
Super User III
Super User III

Check this post
https://powerusers.microsoft.com/t5/Building-Power-Apps/Reset-toggle/m-p/28023

If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution

I would like to reset the toggle upon the failure of an if clause.

In the "oncheck" field of the toggle, I want to put something like:

If("this is is true",
"than update the list containing this toggle",
"else reset this same toggle"
)

 

WarrenBelz
Super User III
Super User III

Hi @suoko ,

You don't need a variable - I will it toggle Toggle1 - replace this with your toggle's name.

Firstly, make sure the Default of the Toggle1 is what you need to reset it to (I assume false).

When you want to fire the reset - just put 

Reset(Toggle1)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,454)