Any way to run advanced Filters on Server Side

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?

Thanks for the reply and suggestion.

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.

Sorry I don’t have a solid answer.

1 Like

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.

  1. Create a new data type called Non-Matching Game with these fields:
  • User
  • List of Games (assuming there is data type called Game)
  1. 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.

I hope this gives you some idea.

4 Likes

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.