Stuck with sorting my repeating group by number

Hello guys,

I’m completely stuck in the development of my app. Very briefly, I’d like to filter the countries in descending order.
I have a User data type with a Country field. Each person in this list has a country and I’d like to rank them in order of importance. The screenshot here shows the problem I’m facing.


I can’t filter at all the way I want, if anyone has a solution I’d love to hear from you! Thanks a lot!

Is order of importance a field on the user datatype? If so, you can use the sort by field on the RG


No it’s not.
I have my users with their country in a data type. I want the RG to show me how many users are from a specific country, to show me the respective number and put in #1 index Brazil (let’s say there is 20 users from there), then #2 Armenia (let’s say there is 10) and Ethiopia #3 (let’s say there is 5).

Where you circled Sort by doesn’t allow me to select country as well.

Hope that “in order of importance” makes sense. Thanks again!

Okay , so whenever you create a user add '‘countries counter +1’ and have a counter in each country data type .Then do a search for countries , data field > count > desc

Try this

1 Like

I don’t want to store it in a data type. Ideally just some math and sorting it in the RG without adding extra data in my db…

You will eventually need it though , you want to filter it with letter ascending , score , user count and much more later on no ? Grouping will limit you if it works .

Seems to give me the same result :confused:

I just want to sort it by the amount of users from a specific country

Have a look at this setup and see if you can replicate it:

Could it be because Country is an OptionSet ? I have the same setup yet it doesn’t get it sorted like yours

What exactly is the issue you’re facing now? It’s not being sorted as you’d expect?

M’yeah it doesn’t gets it sorted accordingly I don’t get it


Add a “sort by” operator at the end of that expression. Descending = yes


1 Like

Brazil should come first, then whatever between Ethiopia or Armenia (maybe Armenia first so it gets it sorted by the letter if the count is equal - but at this point I don’t ask for too much lol)

Sweet baby Jesus I love you :heart: Thanks a lot it seems to work !!!

1 Like