Sort checkboxlist by checked and unchecked

i have a list and i would like it to sort itself by putting al the checked boxes alway at the end of the list so the top of the list showes al the unchecked chekboxes.
can anyone help me to do so?

Is that a list of checkboxes ?

1 Like


You could try something like this:

sortChkbx.aia (3.3 KB)

1 Like

thank you that is very smart. i tryed something like this but with a procedure. it did not work:) i wil try this first thing tomorow. thank you so much.

this works perfectly, i would like to set to set the checked items at the bottem
any tips on how to reverse this list?

1 Like

Just swap A and B in the blocks

1 Like

nope i tryed that, does not work. i switched A and B in the ADD ITEMS TO LIST section and i also tryed also switching the B in the contains part at the bottem. nothing works so far.
i also tryed putting NOT checkboxchecked did not work
and i tryed to put in reverse list, this should work but it did not:( maybe i put it in the wrong spot?

I believe that if you only add the reverse list block when you set global chkbx status to .. in the provided code by @TIMAI2 will do what you need

1 Like

OK A&B not good characters. Use | for first and third text blocks, and ? for second text block.

If you are likely to use either of those characters in your checkbox text, then use obscure characters that you won't use in your checkbox text

1 Like

This problem is equivalent to stacking two List Views vertically, one for checked and the other for unchecked.

Search this board for multiselect for another sample.

1 Like

thats the place i put it but it does not work.

no that is not working either. its strange because it works realy great exept for me not be able to flip it.
i also tryed to set Not before checked but did not work, and now i tryed setting Not before get item in the 3 tekst in select list index. it only makes it worce

no its not because tim already solved that problem. the only problem left is getting the checked items at the bottem instead of at the top. looks like a simple error but i have not been able to fix it.

When testing with companion the provided aia by @TIMAI2 with the addition of the reverse list block at the position shown in the above picture works for me

unfortenatly it doesnt work for me. i even made a apk to try if it would work outside of companian but it did not.
i wil upload my blocks maybe anyone here can help me figure this out.

Please try this, it works OK for me, checked checkboxes sorted to the bottom.

sortChkbxV2.aia (3.3 KB)

it did not work for me because i have a listvieuwer hanging on the checkboxes.
but i solved it by doing this. i made two new lists to make it work. thank you so much much for al your help and your patient. i saved your solution for the future:) its a great way to make lists.

That would leave you with a list of 'true' values in TinyDB, all alike, and useless to reconstruct the individual check box states later.

It would make more sense to store a list of unique values associated with the individual check boxes, like

  • index in a global list of the check box components
  • unique check box text values (requires look up code later)

P.S. you forgot to clear your list at the start of the procedure.

Did you test my project by itself? Did that work ? If so, you apply this to your other blocks, using the support list data for any listview that is "hanging"....