Branching and calculation lets you use the whole arsenal of the Advanced Logic tools that Typeform has to offer. You can add multiple variables to your typeform, recall information, skip questions and calculate scores and price. Read on to find out how.
In this example we’ll show you how to create a pizza order form, and let people choose the size of their pizza, add extra toppings, and optionally select a drink. Then we’ll let Branching and calculations do the math, and add up everything in a neat Payment question.
First, add your questions to your typeform:
1. Start with a Welcome Screen:
2. Next, let’s ask people what size pizza they’d like with a Multiple Choice question:
3. Then we’ll ask people what kind of dough they’d like with another Multiple Choice question.
4. Now it’s time to choose topping with the help of another Multiple Choice question. You can enable Multiple selection in question settings to let people choose up to 3 toppings:
5. Let’s add a Yes/No question to ask people to confirm their choices. You can type @ to use Recall information and show them what they selected:
6. Add another Yes/No question to ask people whether they want extra toppings for an additional fee.
7. Now people can pick their additional toppings from a Multiple Choice question with Multiple selection enabled, where they can choose as many additional toppings as they want:
8. Next we’ll use a Yes/No question to ask people to confirm their selection, and show them which toppings they chose and how much it will cost them with Recall information:
9. Next, we’ll ask people if they want to order a drink for an additional fee with a Yes/No question:
10. If they say Yes, they can choose what they want from the drink menu with a Multiple Choice question, where they can only select one option.
11. Let’s add a final Yes/No question where people can review their order with Recall information:
12. Now we can ask people for their delivery address with a Short Text question:
13. Then we’ll ask for their number with a Phone Number question:
14. We’ll ask for their name with another Short Text question:
15. Finally we’ll create a Payment question where people can provide their credit card details and pay for their order. We’ll also show them the final price with Recall information:
16. Now when people hit Submit, they’ll see an Ending screen letting them know that their order is on its way:
Now that we’ve asked everything, it’s time to use the magic of Advanced Logic!
1. Go to the Logic panel and select Advanced:
2. Click Variables and use + Add variable to create your own, then hit Save when you’re ready. For this use case, we’ll add a custom drink, size and toppings variable:
3. Click Branching and calculations to start adding Logic to your order form. First, let’s add values to the size variable like so:
4. Then add the size variable to the final price:
5. Add jumps to your Yes/No question to take people back to the previous question if they say No and to the next question if they say Yes.
6. Then add Logic to the Yes/No question take people to the additional topping selection, or let them skip it if they don’t want additional toppings:
7. Repeat the process for size with the toppings variable. The difference here is that each topping costs the same, but people can choose multiple toppings which will then be added to the final price.
8. Then add Logic to the Yes/No question confirming the additional toppings.
9. Do the same with the Yes/No question asking about adding a drink:
10. Then repeat what you did with the size and toppings variables for the drink selection:
11. Add your final jumps to the review order Yes/No question. This way when people see a mistake in their order details, they’ll be taken back to the first question, and if they confirm their order, they’ll be asked to add their contact details:
That’s it, your order form is ready! You better start heating up the oven and chopping your ingredients to bake all that delicious pizza.
If you feel like one pizza is not enough, you can check out our article about how to multiply by quantity selected here.