PowerApps collection not cleared after closing app

Multi tool use
PowerApps collection not cleared after closing app
I have a collection in my PowerApp called Collection1
.
I also have a gallery called Gallery1
. I use the collection to keep track if all checkboxes are checked in the gallery, so then I can enable a button.
Collection1
Gallery1
AgreeCheckbox
in Gallery1
has the following actions:
AgreeCheckbox
Gallery1
OnCheck: Collect(Collection1,ThisItem)
OnCheck: Collect(Collection1,ThisItem)
OnUncheck: Remove(Collection1,ThisItem)
OnUncheck: Remove(Collection1,ThisItem)
And then the button has the following displaymode:
If(CountRows(Collection1) = CountRows(Gallery1.AllItems),
DisplayMode.Edit, DisplayMode.Disabled)
I'm currently running the App in preview mode, but sometimes items get stuck in Collection1
and next time the button is enabled even if only half of the checkboxes are checked (I have 6 currently, and intermittently 2 or 3 items get stuck in the Collection1
.
Collection1
Collection1
I've added OnStart: Clear(Collection1)
to Screen1
(where all this is happening), but this didn't help.
OnStart: Clear(Collection1)
Screen1
What am I missing here?
2 Answers
2
I use a similar mechanic in my apps, so I can help you with this. Can you let me know what you have set the Default property of AgreeCheckbox to?
I hope this helps.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.