Forum Academy Marketplace Showcase Pricing Features

Sorting a Repeating Group (RG) by more than 1 sort field

I have a simple RG that displays notes (comments) that the user adds. These notes are sorted so that the newest comment is displayed at the top of the list. I have also created a checkbox so certain comments/notes can be ‘pinned’ to the top of the list.

I would like the RG to sort first by pinned comments, and then by date. This seems to work to a point. It will sort the pinned comments at the top and by date, but the unpinned comments no longer sort by created date.

Can a repeating group be sorted by multiple fields? Here is how it looks currently. Notice the note number. Note 1 was created first, followed by note 2, 3, etc.

Here is the search settings of this RG…

I should also note that if I pin note 6 (or any note that is out of order) and then unpin it, it sorts correctly. I don’t want to have to pin and unpin ever note though to get the sort to work. Is there some sort of workflow or refresh list option that might do the trick?

Anyone have ideas or information on this? Do RG not support 2 sort fields? It looks like it will follow the sorting of the first sort field, but not the 2nd.

trying sorting by pinned on the search constraint and then after the search expression add the extra operator :sort by and sort by the date

Great idea. Unfortunately, it seems to ignore the 2nd sorted: operator. If I sort by pinned on the constraint, the added sorted: operator doesn’t do anything. It really seems like the RG sorting is limited to 1. Any other ideas or plugins that might help? It seems like a simple thing to do, but I can’t figure it out.

I appreciate the help/suggestion nonetheless.

Maybe try to do a search for the pinned and have the sort on the constraint and then use the :merge operator and merge it with a search for the ‘not-pinned’ with the sort on the constraint.

Another good thought, but that is a no-go either. It only follows one of the sort constraints. Maybe someone from Bubble can note if this is a restriction when sorting RG, or if it is possibly some sort of bug.

If there are any other ideas, please feel free to share.

This topic was automatically closed after 70 days. New replies are no longer allowed.