I have 3 data types:
-
Tags
-
Meditations with a list of tags:
Meditations also get rated by how many users listened for more the 2 minutes with a click counter:
- Users with a list of tags:
I would like to assign (API WF) the 4 meditations with the highest click count to the user favourites based on his tags.
I really don’t know where to start…
Thanks in advance!!
Hey Paolo,
TLDR, you want to intersect lists of mediations that contain each of the user’s tags, sort by review DESC, and use the top 4 results to save as favorites.
Note: I wouldn’t do this on the user table and based on your use case and whether you envision mediations having many tags or tags linking to many mediations you may want to store the mediations that contain the tag in a list.
1 Like
Hi!
meditations have many tags.
users just a few.
The tags from the user come from the onboarding.
based on those choices the new user made, I want him to find some suggestions in his favourites.
Please explain why you wouldn’t assign those meditations in his table?
Cheers!
I meant meditations and tags links. A meditation can have many tags but will a tag also be linked to many meditations
Yes it should be linked to user but not necessarily in user table which you want to keep as light as possible (instead in a Favorites dataset which contains user field and list of favorite meditations, etc.)
1 Like
OK. Got it.
Well, I guess it’s to late for that… my user table ended up being less then light.
I am already using the favorites field in my user data type. We already have several thousand users… I guess I stick with that setup for now.
Having said that. I have no clue on how to address my issue
I tried it somehow but there might be something still not working. this way…
It’s not too late. Better sooner than later.
I don’t know all the ins and outs but you’re trying to intersect the user’s tags with a search for tags; both of those lists seem completely wrong.
I recommend watching some videos to help you understand database fundamentals and basic bubble searches. Skipping over these will lead to problems later on.
So what you are saying is, that with my database setup it won’t be possible to intersect and filter as I am trying to do?
BTW I forgot to mention:
The datatype setup comes from a template, which used to be from Zeroqode, now Rapid Dev. I added the Datatype Tags.
When I decided to use it, I was completely new to Bubble. Others, more experienced Bubble devs told me what a mess it is months later…
I’m not saying that won’t be possible using the schema. I’m saying your query is completely wrong.
And oh yeah all templates are a disaster especially from one of those vendors.
I’m not sure where you are in production but you should immerse yourself in the fundamentals of Bubble, hire a coach, or hire an expert to reconfigure your app.
beyond production… Webapp, iOS and Android apps working since over a year. 7k+ users created.
Hence: I will get that query straight. One way or the other…
Yes, you can get the query straight. That’s not the hurdle; you shouldn’t be doing it on the front-end and shouldn’t be intersecting the user tags. What you should do intersect a list of all mediations that contain each of the user’s tags and then sort accordingly.
But that doesn’t fix the DB schema which will continually come back to bite you until you fix the actual issue! (see next post)
Whether or not it’s in a app wrapper doesn’t make a difference. 7k users is not a big deal. I’ve completely reworked DB schemas with millions of records.
It comes down to 5 or 6 steps, unless there are some super-nested workflows. I’ve never mapped it out, but here are the basics (offhand).
-
Set up the proper schema in the current DB by adding the datasets, lists, and fields (DO NOT delete any of the fields that the new fields are replacing). These fields are the “New fields”. The fields they will be replacing are the “Old fields”
-
do a recursive WF to set all the New fields with the value of the Old fields (optional based on a couple of factors)
-
Update ALL actions / WFs where the Old fields are being created / modified or deleted and mirror those actions in the New fields within those workflows. DO NOT use DB triggers for this step. If you have shi$&@y documentation / notes for these workflows, make sure you update it.
-
One WF at a time, update each WF that references / uses the Old fields to instead reference / use the New fields (these WFs do not include the actions in Step 3).
-
Test that all references / uses of New fields are working properly.
-
Remove Old Fields in all actions from Step 3. Then delete Old fields and Old datasets
NOTE: It may sound like a lot but if you attack it methodically and know what the schema should be, how to use Bubble and have proper logging set up → it will take 5 - 8 hours of work (spread out over a few days obviosuly).
Hi Thanks for the hint!
Something like that? There must be something missing, since bubble is not happy with that expression.