So I have a repeater group that has it’s ‘type of content’ set to ‘games’.
But i want to ‘sort’ that data by a totally different ‘type’.
here’s the screenshot where you can see my repeatergroup being set to ‘games’ as it’s data type and then on the right, i’m trying to sort it by a field that is contained in a different type (gameworkings). There’s a field in gameworkings called ‘works’ that i’m trying to sort by.
A list is an array. Like, a list composed of the numbers 1 through 5 is:
[1, 2, 3, 4, 5]
If we sorted that list descending by value we’d have:
[5, 4, 3, 2, 1]
You can’t sort a list by a single value. That would make no sense.
Any Bubble datatype (built in or custom — what we call Things) can be either a single value (what I often call a scalar value… a single instance of that datatype), or you can compose a list of such values (a one-dimensional array of such datatypes).
Any field on your custom datatypes can be either a single value or a list.
A Search… always returns a list. Search for Games (no constraints) will return a list of all of the Game objects in your database. (I’m sure you know that, but FYI as a baseline).
If you’re trying to sort a list of Games by the number of “working” ratings corresponding to that list of Games, as I’m sure you’ve discovered, it’s easiest if the number of “working” ratings is just a scalar field on Game. That’s the only type of sort that vanilla Bubble can do.
However, if you can construct a list of numbers that corresponds to the Games in exactly the same order, List Shifter can sort your Games by that.
Another (easier) way to do this is with Floppy’s (one of my commercial plugins) “Count Fields/Sort” action. STILL, however, it is best if “Working” were a list of (anything) on the Game object itself.