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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / On date change, set va...
Power Apps
Answered

On date change, set variable to false

(0) ShareShare
ReportReport
Posted on by 802

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. 

Categories:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

    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

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @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.

     

     

  • Kosenurm Profile Picture
    802 on at

    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 Profile Picture
    802 on at

    Default value for each checkbox on Ground Floor is "GFBanks".

  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    Set every checkbox to have a value in its reset section called (for example)

     

    GFBankReset

     

     

    resetoiptiojn.PNG

     

     

    then in the change of the datepicker, after you have cleared GFBanks add in

     

    Set(GFBankReset,true);
    Set(GFBankReset,false)

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 372 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 303 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 238 Super User 2026 Season 1

Last 30 days Overall leaderboard