Published: November 13, 2023
Using Drupal's Webform Module to Create a Decision Tree
Ever needed to create a "decision tree" or "Smart Answers" feature and didn't know where to start? It's pretty easy if you use Drupal's webform module and add conditional handlers for the confirmation settings (all through a few clicks in the webform UI).
Creating a decision tree is quite easy using the Drupal Webform UI. Here's the outline:
- Create the form
- Add all the questions that you want
- Use the "Conditions" tab in each question to set the conditions for what question shows where
- On the settings page for the form, under "Email/Handlers" add a handler for the confirmation page settings for each potential response in the decision tree.
Here's a video outlining the steps: