Repeating Group with two "Sort by" options

Apologies if this has already been covered, but I cannot find any posts on it.

I am trying to sort my repeating group using two sorts at the same time.


I have a repeating group containing several venues.

I have sorted these venues in my repeating group by distance to user’s location.

In addition to this, I also want to show certain venues as “featured”. I.e. displaying at the top of the RG, while at the same time still displaying the rest of the other venues in their order by distance.

I have tried a simple number sequence to achieve this (alongside the distance sort) with no luck.

I am guessing (and trying to avoid) that my next best bet would be to use a separate RG at the top of the original RG for my “featured” venues.

Hope all this makes sense. Any help on this much appreciated.

I think you need two R.G.s

It has been covered, I don’t know off hand the threads, but comb through the forum and you’ll find the instructions.

Sorry I can’t provide the link to the posts covering it and I forget the instructions, but they are out there floating around somewhere.

1 Like

Interesting problem I think I have a solution though. You could add a “featured factor” to each of the featured venues and instead of sorting by distance you sort by distance*featured factor. Non featured venues factor is 1 featured venues is 0. So now all featured venues will be placed at the top. Side note you would not display this as the distance its simply for sorting.

1 Like

Thanks for the advice. I tried something similar, but It didn’t work out as planned in the end. Have resulted to using more repeating groups, but it’s working out fine now. :slight_smile:

Using two RGs will make it simpler. Also read that we should keep the searches simple and not make them complex. It affects the speed.

1 Like

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