So i got a list of tags that I want to find the reoccurrence of:
[ “tag1”,“tag2”, “tag1”, “tag1”, “tag1”, “tag1”, “tag1”, “tag3”, “tag2”]
and usally if it were objects theres a group by function thats really useful, but it doesnt exist for texts and numbers, so I have to do complicated login and write my own code in order to do this successfully.
Hi James - Reviving a somewhat old thread here but I have a question on your approach. Given the :unique elements approach, would there be any way to sort that list of texts by count (e.g. for display in a repeating group)?
In case anybody else is trying to sort a repeating group that’s a list of texts: I was able to sort it using some custom Javascript and the Toolbox plugin. What I was really trying to do was to take a repeating group of texts and use the Group By / sort functionality from Bubble, but alas it’s not available for lists of texts.
I wrote a quick javascript function that takes the list of texts from Bubble and sorts it. Then I return that sorted list (via bubble_fn_[ ]) to a Javascript to Bubble element. Finally, in my repeating group, I added a condition where if the Javascript to Bubble element’s value list is not empty, make the repeating group’s data source be that Javascript to Bubble element’s list.