Skip to main content

Notifications

Community site session details

Community site session details

Session Id : OBvaWVNDEsuEyr3ZqdjTBt
Power Apps - Building Power Apps
Answered

Toggle button

Like (0) ShareShare
ReportReport
Posted on 8 Jun 2020 13:26:19 by

Hi PowerApps Experts

 

I have a problem with reset of my toggle buttons - when making a new form, they don't reset, I want them all to be "off".

 

I use multiple screens after this format:

https://www.youtube.com/watch?v=N8AsxE__Mw8

 

It seems all my form are in "Edit" mode - why I can't use this formula I did when "only" using "New" & "Edit" modes:

 

If (EditForm1.Mode = FormMode.New,
false,
ThisItem.DataCard1
)

 

What to do?

 

BR

Bo

  • Community Power Platform Member Profile Picture
    on 10 Jun 2020 at 11:03:42
    Re: Toggle button

    Hi

     

    Made a bummer, my default in my SharePoint list was "default; On" - Doh!

     

    Thanks for your reply and help ;0)

     

    BR

     

    Bo

  • Verified answer
    v-yutliu-msft Profile Picture
    on 09 Jun 2020 at 05:34:17
    Re: Toggle button

    Hi @Anonymous ,

    Do you mean that when you open a new form, your toggle will not be reset?

    The reason is that toggle is not a resettable control.

    If you use ResetForm function or NewForm function, the toggle will not be reset. Using Reset function will not work neither.

    So the solution is: set toggle's default based on form's mode.

     

    I've made a similar test for your reference:

    1)the edit button's OnSelect:

    EditForm(Form1)

    2)the add button's OnSelect:

    NewForm(Form1)

    3)the toggle datacard's Default:

    If (Form1.Mode = FormMode.New,
    false,
    ThisItem.bb
    )
    //bb is my fieldname, please replace with your fieldname

    the toggle's Default:

    Parent.Default

     

    Then if the form's mode is new, the toggle will be false by default. If the form's mode is edit, the toggle will be that field's value by default.

    All the actions before will be cleared, which looks like reset toggle.

     

     

    Best regards,

  • mdevaney Profile Picture
    29,987 Super User 2025 Season 1 on 08 Jun 2020 at 13:33:37
    Re: Toggle button

    @Anonymous 
    Have you tried putting this code in the OnSelect property of a button?

    ResetForm(EditForm1)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 264 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 138

#3
stampcoin Profile Picture

stampcoin 123

Overall leaderboard
Loading complete