Display a list of unique elements from a field, ordered by number of occurrence

Hello,

Bubble is still very new to me, here is my problem :
I have a Data type named “Restaurant”, and each restaurant has a “City” field.
I would like to display in the repeating list the list of cities, ordered by number of restaurants in the cities.

For example : my Restaurant data table :
Restaurant A | New York
Restaurant B | Paris
Restaurant C | Paris

and what I would like to display thanks to a repeating Group :
Paris [in the first cell of repeating group as it has 2 restaurants]
New York [in the 2nd cell of the repeating group has it has only 1 restaurant].

Is there a way to do this in Bubble ?

Thank you so much

Antoine

@caffinantoine Did you ever get this working? I’m trying to do the same thing.

What I did is that I created a data type called City Counting with a Field “City name” and a Field “City Occurence”.
When I create a Restaurant thing, if it is in a new country I create a new Country Counting thing (with a workflow), and if it’s not a new country I do Occurrence = Occurence +1 (workflow again).

Probably not the best way to do it but I didn’t find another way yet :frowning: :frowning:

I ended up doing something similar. Thanks for letting me know!

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