Signup

Using and/or with Logic

When you set up your Logic, be sure to use "and/or" correctly. If you don't, your form might not work properly. This article will give you an example and explain how to use "and/or".

Here’s a common mistake with and/or

This form asks ‘Are you a cat or a dog person?’. The answer will send them down different logic paths, and later we ask both groups ‘So now, pineapples on your pizza?’.

2024-04-25_11-51-05.png

From question 4, we want to send people to different custom Ending Screens.

If you’re a cat person who likes pineapple on pizza you see this.

2024-04-25_10-13-22.png

If you’re a dog person who likes pineapple on pizza you see this.

2024-04-25_10-14-13.png

But if you’re either a dog or a cat person who doesn’t like pineapple on pizza, we want to show this.

2024-04-25_10-15-06.png

On the pizza question, there are three logical conditions, sending respondents to the Ending screens. The first two work.

2024-04-25_11-38-40.png2024-04-25_11-39-19.png

 

But the last condition cannot be satisfied, and will break your form! Why? Because it’s impossible for someone to have answered Cat and Dog to the question ‘Are you a cat or a dog person?’. Have a look.

2024-04-25_11-43-14.png

The solution is to use or instead of and.

2024-04-25_11-47-02.png

In this way, people who like Cats or Dogs and don’t like pineapple on pizza will see the Ending Screen ‘OK, how about pickles on pizza?‘.

HC_Note_ilu_cropped.png
Note! If your Logic has multiple conditions like the above, remember that 'and' will be executed first and 'or' will be executed later. When you use 'and', this means that two of the conditions must be satisfied at the same time. Make sure that this is possible, or your Logic will fail.
HC_Warning_ilu_cropped.png
Warning! Be careful when using and/or with Logic—if they create impossible scenarios, your form will not work.

Tap into our community knowledge