Sorting elements by different fields in Protopie

I have a project where I want to offer the user a ‘sort’ button, but it seems that sorting a list of elements in Protopie is non-trivial. I know how to do the auto-layout according to each element’s ID# (an internal variable for the component). But I’m not sure I can see any straightforward way to re-assign the ID# values to change the order.

Has anyone tried this and solved it – found an easy way to do it?

If not, then I’ll persist and share any solution I can work out - or share my failure.