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 / Checkboxes untick when...
Power Apps
Answered

Checkboxes untick when opening and closing app

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I've got a gallery with checkboxes

It works fine, however when i exit my app, and reopen it, all of the checkboxes will untick. 

How do i get all my previously ticked checkboxes to stay ticked when i reopen the app. 

I've thought to put a button which will automatically be selected when the app opens, but i am not sure what formula to place in it

My collection is called CollSelected

 

Power1231_0-1690435288860.pngPower1231_1-1690435312188.png

 

Categories:
  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    May I ask what Data Source you have used?

     

    We made a sample for you and which data source is SharePoint List.

    vhanytianmsft_1-1690437280933.png

    Insert A Gallery to show the records.

    vhanytianmsft_2-1690437338016.png

     

    The OnCheck of Check Box just for demonstrating the stored procedure in the formula you provide, you do not need to change your formula.

    vhanytianmsft_3-1690437471142.png

     

     

    Please try this in the Default of Check Box:

     

    If(!IsBlank(ThisItem.LetterSent),true,false)

     

    vhanytianmsft_4-1690437494702.png

     

     

    Hope this will help you,

    Best Regards,
    Tina

  • Verified answer
    JatinSaini Profile Picture
    428 on at

    Hi @Anonymous ,

     

    To retain the state of checkboxes between sessions in PowerApps, you can use the "OnVisible" property of the screen to load the previously selected checkboxes from your collection when the app opens. Additionally, you can use the "OnChange" property of each checkbox to update the collection as the user selects or deselects them.

    Here's a step-by-step guide on how to achieve this:

    Add the "OnVisible" property to your screen:
    Go to the screen properties, find the "OnVisible" property, and set it to the following formula:

     

    ClearCollect(CollSelected, Filter(yourDataSource, trueCheckboxColumn = true))


    Replace "yourDataSource" with the name of your data source, and "trueCheckboxColumn" with the column name that determines if the checkbox should be selected (true) or not (false).

    Set the "Items" and "OnChange" properties for each checkbox:
    For each checkbox control, set the "Items" property to your data source (e.g., "yourDataSource") and the "OnChange" property to the following formula:

     

    If(ThisItem.Selected, Collect(CollSelected, ThisItem), Remove(CollSelected, ThisItem))


    Add a button to save the selection (optional):
    If you want to give the users control over when to save their selections, you can add a "Save" button. Set the "OnSelect" property of the button to the following formula:

     

    Patch(yourDataSource, CollSelected)


    That's it! Now when the app opens, the "OnVisible" formula will load the previously selected checkboxes into the "CollSelected" collection, and the "OnChange" formula for each checkbox will update the collection as the user makes selections. If you added a "Save" button, users can choose to save their selections back to your data source whenever they want.

  • RMCoder Profile Picture
    219 on at

    Canvas apps don’t have any native “state” capture, meaning your app is reset every time you load it.

     

    There are functions to save and load data which are now available as experimental features for the web browser, but they are meant to capture collection/tabular data—the data you save/load won’t directly tick your checkboxes.


    If your save/load data collection can be structured to include true/false values, you could set the checkbox’s default value to whatever you call the “state” property in your records. This would potentially re-tick them when the gallery loads the collection.

     

    The Microsoft Learn Documentation has the finer details for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    perfection, cheers that fixed everything

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard