cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Community Support
Community Support

Re: Gallery Checkboxes and Toggles Uncheck Automatically

Hi @Serviced2000 ,

 

The Toggle value goes back issue is because there is a Patch function in each loop, so the data source will be refreshed in each loop, and the other toggle values would go back.

 

The workaround is easy, bind the gallery to a collection, instead of the sharepoint list directly, so each change in the loop is not immediately reflected in the gallery, then update the collection after the ForAll loop ends.

1. Set App.OnStart property: ClearCollect(myCol,'SP list')

2. Set Gallery.Item: myCol

3. Set Save Button.OnSelect as below, to re-define the collection after forall loop.

 

ForAll(RenameColumns(GalleryName.AllItems,"ID","OID"),Patch('SP list',LookUp('SP list',ID= OID),{TwoOption:If(Toggle1.Value,"Yes","No")})) ; ClearCollect(myCol,'SP list')

 

 

Sik

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,257)