Hi,
I am really struggling with this one.
I have a toggle which, on UnCheck, does this...
Clear(GFTS);
Set(GFBanks, false)
Clear being to clear the collection which is used in a gallery. All OK. It then sets the variable of GFBanks (which is a collection of checkboxes) to false. This works fine.
What I want is for the same to happen when someone changes the date on the date picker, but I can't get this to work. I have tried exactly the same code on the OnChange property of the date picker, and it is performing the Clear command as the gallery goes blank, but is does not uncheck the checkboxes which the toggle does as per the Set command.
Any ideas how to resolve?
Thanks
K.
Set every checkbox to have a value in its reset section called (for example)
GFBankReset
then in the change of the datepicker, after you have cleared GFBanks add in
Set(GFBankReset,true);
Set(GFBankReset,false)
Default value for each checkbox on Ground Floor is "GFBanks".
For the toggle, this sets all the checkboxes to true OnCheck and gives them an ID for use in the gallery (just an internal name for the bank of desks) and then sets the variable for the gallery to true.
On UnCheck of the toggle, it sets the checkboxes to false, and the variable to false to clear the gallery.
ONCHECK
ClearCollect(FFTS,{selection:'1FA-A'.Value,ID:"Bank A"}, {selection:'1FA-B'.Value,ID:"Bank B"}, {selection:'1FA-C'.Value,ID:"Bank C"}, {selection:'1FA-D'.Value,ID:"Bank D"}, {selection:'1FA-E'.Value,ID:"Bank E"}, {selection:'1FA-F'.Value,ID:"Bank F"}, {selection:'1FA-G'.Value,ID:"Bank G"}, {selection:'1FA-H'.Value,ID:"Bank H"}, {selection:'1FA-I'.Value,ID:"Bank I"}, {selection:'1FA-J'.Value,ID:"Bank J"}, {selection:'1FA-K'.Value,ID:"Bank K"}, {selection:'1FA-L'.Value,ID:"Bank L"}, {selection:'1FA-M'.Value,ID:"Bank M"}, {selection:'1FA-N'.Value,ID:"Bank N"});
Set(FFBanks, true);
ONUNCHECK
Clear(FFTS);
Set(FFBanks, false)
This is fine for all or nothing.
When someone selects just one or a couple of the checkboxes, however, the OnCheck and UnCheck for each is...
ONCHECK
Collect(FFTS,{selection:'1FA-J'.Value,ID:"Bank J"})
ONUNCHECK
Remove(FFTS,First(Filter(FFTS,ID="Bank J")))
What I need is, for any time the user changes the date on the date picker, all checkboxes get cleared to unchecked and so the gallery gets cleared.
Thanks for you help
K.
@Kosenurm could you provide a Screenshot of your app as I am not sure what you are trying to do with the checkboxes. Maybe you could also provide a Screenshot of the collection with the checkboxes.
If the checkboxes are within your gallery you may have to throw in a Reset(galleryname) at the end after the variable has been set