I have an RG that I wish to list items and number of users that have each item.
for example,
I have a field in my user type that has a list of items in it, I want to go through all users and display each item only once (no duplicates) and a number beside each item showing how many users have that item. ordered by largest number of users having each specific item.
I’m just stuck. I know its probably an easy fix. just not for me.
Hi there, @baron1… you might not like this suggestion, but one way (and probably the easiest way) to go here is to have a count (number) field on the Item data type, and simply increase the count for an item by 1 every time the item is added to a user’s list.
With your current setup, you can do what you described by having a repeating group where the data source is a search for items. Then, you could have a text or input element in the repeating group that does a count of a search for users where the user’s items list contains the current cell’s item. However, because the count field isn’t stored in a data type, you won’t be able to sort by it.
So, again, a simple count field added to your Item data type could do the trick here, and I hope this helps, even if it’s just food for thought.
This is not in fact easy and there’s no way to do it in vanilla Bubble. You can do it (in a very complex and annoying way) with List Shifter (and you can learn how by reading my amusing little tutorial/story in this thread), but it’s very tweaky.
Which I why I built a dedicated Action for this in my Floppy element. See: