I am facing some serious difficulties to implement what looked so easy at first: sort repeating group with a dynamic field (sort by thing’s thing). It looks like Bubble deleted this option and there are 2-3 other discussions on this topic but I still haven’t understood how to work around this.
Nevertheless, how to rank the results based on the likes from the number of users I follow. If you look at this screenshot below, Lyon should rank on the first position. This is very central for the purpose of my app.
That’s what I’m trying but it doesn’t work. The RG returns nothing at all. Can someone help rank with a dynamic field? Poke @emmanuel@NigelG@romanmg@vincent56
Sorry @NigelG but I don’t manage to create a dynamic table of “cities my friends like”. Each user will like different cities and each user will follow different users so this database should be very dynamic.
Did I misunderstand your tip or is it simply not possible?
Can you please explain with a bit more details on how you would solve that?
I sent an email to support@bubble.is to get some assistance and here is the reply I have received:
Hi Daniel,
Thanks for reaching out. I recommend adding a field called something like ‘number of current followers’ (of type number) to your ‘cities’ data type. Then, you can add a workflow to your page so that, when the repeating group is visible and the current user is logged in, you make a change to a list of things. Then, in this last action’s property editor, you select ‘thing=city,’ ‘list=RepeatingGroup list of cities,’ ‘field to change= number of current users who like this town (I called them town followers, and then the user followers I called friends) = This town’s list of followers intersects with current user’s friends:count.’ Back on the repeating group, you sort your search by ‘number of current followers’ ‘descending = yes.’ I tested this on my app and it worked. I am attaching screenshots of the relevant actions for clarity.
Please let us know if you have additional questions.
This looked like a good solution! It worked partially but it looks like this wouldn’t be sustainable if multiple users would use the app simultaneously. Laura from bubble recommended me to look into solving that through a Javascript Plugin:
You are right. Unfortunately dynamic sorting is not supported at this stage, although it is on our roadmap. It could perhaps be done through a custom plugin using Javascript, so you may want to consider doing this or hiring someone to do it for you. Many of our users find freelancers on the forum here. You can start your own thread with your requirements or respond to an existing one.
That’s it, I will give it a try with a freelancer and let you know if I come any further.