In powerapps how can the toggles remember it's position

Viewed 20

I'm using a gallery with a toggle on it and every time the toggle is checked I use the code:

Collect(colCheckedItems2, ThisItem)

to put that Item into a collection and use Remove(colCheckedItems2, ThisItem) to delete the item when unchecked.

Whenever I make the gallery invisible and then visible again, the gallery doesn't remember it's state. I tried solving by setting its default value to

If(ThisItem.Title in 'colCheckedItems2'.Title, true, false )

Here, "Title" is the name of a column shown in the gallery.

However, when I try this, the gallery is getting a little spacey. When I check only one Item and I revisit the gallery, other Items are remembered as "checked".

Any help would be great

0 Answers
Related