Forum Documentation Showcase Pricing Learn more

Sorting Repeating Groups That Use :grouped by?


#1

Hello everyone!

Has anyone found a way to sort a RG that’s using :grouped by in a way other than alphabetical?

In my case, I have meal deals that get grouped together when there’s the same meal deal listed multiple times because it’s offered at different restaurant locations. As such, my results show alphabetically by the restaurant, as that’s what I’m grouping them by.

I would love to organize these by the distance the deals are from the user (which can’t be stored). @romanmg, I was attempting to do a method similar to what you have here - any other ideas?


#2

Hello
already ask, but no response

The ugly turnaround I had to use is creating another field like “Sort_number” on the Thing I want the aggregated result to be sorted, and then use an AVERAGE on it.


#3

Yep, I do something similar now. Since the distance will be a dynamic value that can’t be stored, I’m looking to do another approach.


#4

Hi all,

After lots of trial and error, I found a way to sort a repeating group that uses :grouped by!

What you have to do essentially is create your repeating group normally like you have been, and use the :grouped by like normal. However, in each cell of your repeating group, you need to add another group. You can then set this group to be the elements you need by using the repeating group as a list of data, and matching it against search results, using the cell index to create the new list.

Since this is very confusing, here’s a screenshot of how I set up that group that’s in each repeating group cell (group on the right, search being run on the left):

I can now sort by any field for my data types! Hope this helps :slight_smile: