web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Reset Checkbox in nest...
Power Apps
Answered

Reset Checkbox in nested Gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I do have the following scenario:

  • 1 screen with an overview of all kind of menus. The days displayed are a vertical gallery with a nested horizontal gallery to show the menus per day. The checkboxes on the screen are for a thing so called "multi-menu-order" for employees who want to order menus for the whole week.
    11-10-_2018_08-16-16.png
  • 1 screen for the multi-order which shows all selected menus from the previous screen in a horizontal gallery.
    11-10-_2018_08-17-56.png

 

Now the desired result would be: If I click on the back button I get to the previous overview and the selected checkboxes are still selected, which is the case. But if I click on the button "Order menu", the checkboxes should be resetted, which is currently not working.

 

Multiple Order Screen

  • Back Button
    11-10-_2018_08-21-03.png
  • Order Button
    ForAll(SelectedItems,Patch(
     MenuOrder,
     Defaults(MenuOrder),
     {
     Titel: "Mehrfachbestellung",
     MenuID: {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id: Value(Menü.ID),
     Value: Value(Menü.Title)
     },
     Anzahl:Value(AnzahlValue_1.Text),
     Verrechnung: VerrechnungValue_1.Selected,
     'verspätetes Essen':verspätetesEssenValue_1.Value,
     'Tisch reservieren':TischreservierenValue_1.Value,
     Bemerkungen:BemerkungenValue_1.Text,
     KostenstelleLU: {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id: Value(KostenstelleValue_1.Selected.Id),
     Value: Value(KostenstelleValue_1.Selected.Value) 
     },
     'Art der Verrechnung': DataCardValue42_1.Selected,
     Menüdatum: MehrfachbestellungDate
     
     }
    ));
    UpdateContext({ResetCheckbox:true});
    UpdateContext({ResetCheckbox:false});
    Notify(Switch(Language,"GER", "Danke für die Bestellung", "ENG", "Thank you for ordering", "FR", "Merci d'avoir passé commande"));
    Back()
    found here: https://powerusers.microsoft.com/t5/General-Discussion/Reset-Checkboxes-in-Gallery/m-p/101559#M37545

Menu Overview

  • Structure
    11-10-_2018_08-25-17.png
  • Checkbox Properties
    Default = false
    OnCheck =
    Collect(SelectedItems, {Menü:ThisItem,MehrfachbestellungDate:DateValue(glryDayMenüplan.Selected.lblMenüplanDateFormat.Text)})
    OnUnCheck =
    Remove(SelectedItems,{Menü:ThisItem,MehrfachbestellungDate:DateValue(glryDayMenüplan.Selected.lblMenüplanDateFormat.Text)})
    Reset = ResetCheckbox

Is it just not possible to reset checkboxes in nested galleries or is there anything missing from my side?

 

Cheers,

uhlme

Categories:
I have the same question (0)
  • Lisabel0 Profile Picture
    154 on at

    Personally I do not think this could be achieved. You have many variables to set on the checkboxes.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Is there really no solution to my problem?

  • panand99 Profile Picture
    641 on at

    Hi,

     

    Are you resetting your form once you clicked on "Order Menu" button?

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Which form do you mean? The menu overview?

  • Mike8 Profile Picture
    1,330 on at

    Hello uhlme,

    I have just created a new app.

    It contains two galleries and a button.


    Gallery1 contains a label control and Gallery2.
    Gallery2 contains a checkbox control.
    CheckBox1.Reset = vReset
    Button1.OnSelect = UpdateContext({vReset:true});UpdateContext({vReset:false})

    I click on random checkboxes and when I press the button they reset.
    So the proof of concept is there. 
    Can you try it in a new simple app? Does it work for you?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Do you do this on the same screen or is the button on a separate screen?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I tried the simple app as you mentioned. It works if the button and the other controls are on the same screen, as soon as I move the button to another screen it doesn't work anymore...

  • Mike8 Profile Picture
    1,330 on at

    Hehe. Okay, got it.
    Your button is on an other screen.
    UpdateContext creates a local variable. You can use it only on the same screen.
    You can use the Set() function to achieve what you need.

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-set
    If you need help, let me know.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for the help so far!

    So the command would still be like this

    btn.OnSelect = Set(ResetCheckbox,true);Set(ResetCheckbox,false)

    And Checkbox.Reset = ResetCheckbox

    I've tried that in the app and that didn't work...

     

  • Verified answer
    Mike8 Profile Picture
    1,330 on at

    Yes, this is it. It works for me. Try it to your sample app.
    You may need to change the name of your variable because you have a Global and a local variable with the same name.
    btn.OnSelect = Set(ResetCheckbox1,true);Set(ResetCheckbox1,false)
    And Checkbox.Reset = ResetCheckbox1

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard