Hey guys, I have been using Bubble for the past 2 years and this is the first time I am seriously stuck with a functionality. Any help would be greatly appreciated.
So, what I am trying to do is build a game matching system where the database has 1000+ games and the user will fill out a form with their preferences e.g. Platforms owned, Liked Game features, Liked genres etc. Please keep in mind that most of these are lists.
Now, I have a matches page where I want to display all the games that matches the preferences. There are a total of 7 preferences that all should match with the gameâs properties in order to be displayed.
For instance, This gameâs available platforms intersect with current userâs preferencesâ owned platforms count is not 0. Below are all of the constraints I am using in advanced filter:
Now, these constraints are run client side so these will slow down the page massively. There are a few other constraints which are in the original search so they are run server side but these canât be moved to the original search constraints due to âintersect withâ functionality.
I would highly appreciate it if you guys can suggest any way to move these filters to the server side. I have tried using API workflows but as you all know, Bubble doesnât recognize the returned data as bubble data type anymore.
Thanks in advance. Looking forward to hearing your suggestions
Could you have an action that is make changes to a thing that basically just searches for something so you have that list, then you can reference it in subsequent steps as âresult of previous stepâ and then use the intersect with operator?
Unfortunately, this wonât help as we are still using the âintersect withâ operator and that is run client side. If I am correct, the key to improving the performance will be to somehow run this âintersect withâ operator on server side or replace it with something else.
Would love to hear any other ideas you or anyone else may have.
Okay, I see now, the Advanced filter is not available in a search performed in an action.
I have used some plugins for âserver side variablesâ that I donât know if they had the function for using intersect with or not, but may be worth a try as most of them are free plugins.
Another alternative would be some custom Javascript that I do not know, but likely some others on the forum would. @hergin Iâm curious if you have a solution using native Bubble and your native bubble warrior skills mixed with Javascript knowledge.
If it is not possible in Bubble than maybe connecting to a 3rd party backend that would likely be able to do it very quickly as well.
I guess this is Bubbleâs one of the weakest points: a business logic layer in between data and UI.
It may not be the ideal solution but I would probably create another data type to keep track of either the games matching or not matching a userâs preference (depending on which one would mean a smaller list) so that a userâs matched games are always there without filtering. Of course, this requires adding small database triggers here and there.
Letâs take the ones tracking the games not matching a userâs preference.
Create a new data type called Non-Matching Game with these fields:
User
List of Games (assuming there is data type called Game)
Various actions in the game will result modification to this list:
When a game is removed from userâs wishlist, add the game to this list.
When a user dislikes a category, add the games in this category to this list.
A new game is added to the system, modify this data typeâs matching users.
Etc. etc.
These can be database triggers.
Whenever you need to show matching games, get all the games:minus this list of the user.
Hey Hergin, thanks for taking the time to share your valuable thoughts.
This is what I had in mind a last resort but wanted to see if there are any better alternatives. I have seen others struggle with âfilteredâ as well on this forum so at least I am not alone.
So, until Bubble makes it possible to run advanced filters on the server side, I will just have to use the database method I guess.
Thanks all for your inputs and amazing suggestions.