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?’.

Screenshot 2024-09-30 at 12.22.16.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.

Screenshot 2024-09-30 at 12.25.16.png

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

Screenshot 2024-09-30 at 12.26.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.

Screenshot 2024-09-30 at 12.27.22.png

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

2024-07-10_14-39-51.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-07-10_14-43-32.png

The solution is to use or instead of and.

2024-07-10_14-46-07.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