Forms & data

What is conditional logic?

Conditional logic uses an answer or another condition to decide what happens next, such as showing a relevant follow-up question only to the people who need to answer it.

By Plainview WebReviewed

The meaning

In a form, a condition connects an earlier answer with a later question or section. The rule might be as simple as showing an address field when someone chooses delivery. Other workflows use conditions to route a request or choose a confirmation. The particular behavior must be defined when the form is built.

Start by asking what makes the follow-up relevant. Keep that relationship understandable to the visitor and the person maintaining the form. A short, clear question can be easier to use than a complicated set of branches. Conditional logic is most useful when different answers lead to meaningfully different needs.

An example

A fictional website inquiry

The first section asks whether someone needs a new website or improvements to an existing one. Choosing the existing-site option reveals a section asking for its address. Choosing a new website leaves that section hidden, while the contact details remain available on both paths.

Plainview’s Form & Intake Planner can model this with a Select field in an earlier section. Its preview clears answers when their section becomes hidden. Try entering an address and then changing the project type to see why that behavior matters.

When it matters

A relevant follow-up can collect useful detail without asking everyone to work through unrelated questions. It also makes the plan more specific: the person building the form knows when the question appears, whether it is required and which answer controls it.

Test every path, including changing an earlier answer. Check keyboard use, whether newly revealed content is understandable, and whether hidden questions can block completion. Decide explicitly what happens to answers that are no longer relevant.

A common confusion

Hiding a field does not secure its contents

A display rule is not a substitute for checking submissions on the server. The finished system must validate the answers it receives and handle irrelevant fields deliberately. The planner provides a specification and preview; connecting delivery, storage and server checks is part of building the working form.

Use it in practice

Sources & further reading