Can Bubble support decision tree logic, and if so, how?

Hi all!

I am currently working on an access-to-justice app, where my first (and most important) user flow needs to employ a lot of decision tree logic.

Essentially, I am trying to create conditional Workflow logic as the user answers a series of questions, with the goal of reaching a final outcome (i.e. if answer to Q1 is Yes, move to Q5; if No, move to Q2; and so on, until the decision tree results in a final outcome, i.e. “You have completed the self-screener. Based on your answers, you should file an [X] complaint with the [X] agency”).

I think Bubble has the capability to help me design this (ideally on one page), but I would love any thoughts/suggestions/guidance on how to approach it so I don’t pick the wrong path from the outset. Am I working with option sets, and if so, how do I make each option within the set conditional based on prior answers? Or is this one massive workflow with conditional popups?

Thank you all!!!

Using option sets is the right approach I think.

Add an attribute to the option set that is of the same option set type…this way you can use that attribute as the ‘next option’…you can do this so you actually have two attributes, one for yes and one for no, but there are going to be many considerations based on your actual question types etc. but for simple yes/no answer types, this is fine.

I’ve built an app like this before. The client specs were a little different and there were some js calculations, but here’s an outline of the logic:

Each Question has a list of conditional Questions, that must all evaluate to True for the Question to be active and on the User’s view.

Whenever a Question evaluates to True, it’s added to a list of active Questions for each User. A timestamp is recorded.

The dashboard/survey page shows a list of Questions that are active for the User, sorted by their timestamp added.

Additional calculations are done in the backend, etc.

Hope this helps!

Thank you both! So to Boston85719’s point, would I have one option set with however many questions I need for my decision tree, and each Q within that set has an attribute of Yes/No, which I can then employ as a conditional (or a workflow conditional)?

And to Dannyliu’s point - was the app you build using the logic you outlined also employing option sets? But did you make a new option set for each question with the list of conditional questions being the “options”?

This is really helpful, thank you both!

This may be oversimplifying but the way I would do it is have Question as a data type with the following fields:

  • Question text (text)
  • Next question if yes (Question)
  • Next question if no (Question)

So based on the user’s response it knows exactly which question to show them next.

Agree with @nocodelife. Built something similar before, worked.

Got it! I think this is what you and @nocodelife are getting at? https://www.youtube.com/watch?v=-8PiT8i8_-c&ab_channel=BubbleTipLister