[Solved] How to restore a list? (not listviewer)

Can anyone tell me how, after removing items from a list, I restore the list to its initial state with all items present?
I have 21 items in my list but will only ever pick and remove 20 of them. I want to reset/refresh the list back to original state when there remains only one item in the list.
Cheers to all.

Have a variable to store the original list and whenever you want to restore it just assign this variable to the listview.items property.

This should do the trick.

3 Likes

Thanks, but I am not using a listviewer component. It’s just a list of strings/text.

1 Like

The same applies. You will have two different lists having the same list of items. Your App will work on one of them but the other list is kept intact. When you want to restore items in the list that you worked with just copy the complete list over to it.

Hope this is clear. :slightly_smiling_face:

2 Likes

How do I query the list to determine when there is just one item left (ie 20 items removed and 1 remaining)?

1 Like

Use length of from the list drawer.

assets_-LAn5scXl2uqUJUOqkJo_-LAn5wecEraNWaG7Ig2g_-LAn67CR30LSLOEEB7BJ_blocks-lists-βœ•-fig-4

3 Likes

This worked for me.
:slight_smile:

2 Likes

Please mark it as solved. Many thanks

1 Like

A post was merged into an existing topic: Smart Audio Shuffle