How do I not repeat myself?

How can I turn conditions into something reusable?

In this example a new movie is created only under certain conditions, which are quite long. Every time I create a movie in another context I would have to copy paste these conditions, which then in turn makes the app harder to maintain, in case of changes to these conditions.

How are these things solved in Bubble?

Woah. Yeah those are some pretty unmaintainable conditions there.

It’s impossible to give a proper answer without digging in to the details of your app architecture, but two things that might help:

  • Create a list of the genres that the movie is not allowed to have (such as in a hidden RG on the page, and when you create the movie you just check if the current movie’s genre is in that list
  • For each genre/type, have a yes/no field can be movie (or some equivalent. When you create a movie you check if it’s genre’s can be movie field is yes

Hope that points you in the right direction!

1 Like