Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

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

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started