Vibha's data and monitoring platform · vibha.org

Conditional logic

A paper form sometimes says “if you answered Yes above, skip to question 12” — and trusts the person filling it in to actually do that correctly. Conditional logic is that same instruction, except the form enforces it itself: a question can be told to appear or disappear automatically, based on what was answered earlier, so nobody has to read an instruction and follow it by hand.

A real example first

A satisfaction survey asks “How would you rate this training?” on a 1–10 scale. Only when someone answers 6 or below do you actually want to ask a follow-up: “What could we have done better?” Everyone else — the people who were already happy — should never even see that question.

That is a single rule: when the rating question is answered with a low score, then show the follow-up question. Here is exactly what that rule looks like once it is set up:

Building one, step by step

  1. 1Open the Logic panel in the builder — it sits alongside Build in the same toolbar the rest of the builder uses.
  2. 2Click Add rule, then pick the trigger question — the one whose answer is being watched. This has to be a question that already exists earlier on the form; you need at least two questions on the form before a rule can connect them.
  3. 3Pick the condition: is equal to, is not equal to, contains, is greater than, is less than, or has any answer. If the trigger question is a dropdown or multiple-choice question, the value you compare against becomes a dropdown of its actual options instead of a box you type into — so you pick “Andhra Pradesh” from a list rather than risk mistyping it.
  4. 4Pick the target question — the one that gets affected — and whether the rule should Show or Hideit. A rule cannot target the same question it watches; asking “if this question is answered a certain way, show or hide this same question” could never settle on an answer, so that pairing is not offered.

Rules run live, the instant the respondent types or picks something — not only when they move to the next page. A question that should disappear does so immediately, so nobody is ever shown, even briefly, a question that turns out not to apply to them.

What actually happens when a question is hidden

  • It is not just visually tucked away — it stops existing for that respondent. Nothing is rendered, and no answer for it is collected at all.
  • If it was marked required, that requirement stops applying. Nobody can be blocked from submitting by a question they were never even shown.
  • Anything they may have typed into it earlier — before a change of mind hid it — is discarded when they submit. A stale answer left behind by an earlier choice never quietly survives into the final response.
  • The exact same check runs again on the server the moment the form is submitted. A respondent cannot use their browser's developer tools to reveal a hidden question and answer it anyway — the server independently decides what should have been shown and ignores anything else.

Rules only work in one direction

A trigger question has to sit earlier on the form than the question it controls. Think of it like a row of dominoes — each one can only knock over the one after it, never one standing behind it. A rule that tries to watch a later question and act on an earlier one is allowed to be created in the builder, but it will never actually fire on the live form, because the respondent has not answered the later question yet by the time the earlier one would need to react to it.

Logic, or Rules and calculations?

The builder has two systems that can both show and hide questions, and it is a fair question which one to reach for. The short version: Logicanswers “should this question be on screen?” and nothing else. Rules can do that too, but also compute a value, require a field only in some circumstances, or check several answers against each other at once.

Reach for Logic

  • "Show this question only if that one was answered a certain way"
  • A simple, single-condition show/hide — nothing to calculate
  • You want the next person reading this form to understand the condition at a glance

Reach for Rules instead

  • A value needs to be computed, not just a question shown ("age from date of birth")
  • A question should become required only sometimes, not shown/hidden
  • A check spans more than one answer at once ("end date must be after start date")

A form that already leans on Rules for other things is often clearer keeping every condition in that one place, even a simple show/hide — see the operators and worked examples on the Rules pages.

Frequently asked questions

What does conditional logic do in a form?
It shows, hides or skips questions based on what someone has already answered.
How is a rule different from conditional logic?
Logic controls whether a question appears. Rules calculate values, make a question required only in certain cases, and validate across several questions.