Skip to Content
CDPGuidesSupport

Logic, Variables, and Hidden Fields

Branch an Ours Privacy survey on answers, show follow-up questions, keep a score, pass in values like a campaign or location, fill earlier answers into later questions, and send each person to the right ending.

BetaThis is in beta. The basics are stable, and more capabilities are on the way.

Use this page to make a survey adapt to each person. Send a 9 or 10 to a "what do you value most?" follow-up and a 0 to 6 to "what disappointed you?", reveal an email field only when someone asks for a reply, tag every answer with the clinic from the link, and end each person on the right thank-you screen. Everything here lives under Logic and Endings in the builder, and the preview follows your rules as you build them.

The Logic section of the Post-visit NPS survey with five Branch after a page rules that set an NPS segment and jump to the promoter, passive, or detractor follow-up, and a show or hide rule that reveals the email question when someone asks for a reply.

Rules. Each rule reads as a sentence: after a page, if an answer matches, set a value and jump to the next page or an ending.


Rules

Select Logic, then Add rule. There are three kinds:

RuleRunsUse it to
Branch after a pageWhen a visitor leaves a pageSkip ahead, end early, or keep score based on answers so far.
Show or hide questionsAs answers changeReveal a follow-up as soon as an answer matches.
When the survey startsBefore the first pageRoute by hidden fields, like a campaign or a plan.

A rule's conditions check answers, variables, and hidden fields, and can require all conditions or any of them. Its actions jump to a page or an ending, show or hide questions, or change a variable. Rules run in order, and you can reorder, duplicate, or delete them.


Variables

Variables hold a value you compute while someone answers, such as a running score or a label like "promoter". Each one has a name, a type, and a starting value. A Branch after a page rule can add to, subtract from, multiply, or divide a number, or set and append to a label. Later rules can branch on the result, and an ending can show it.


Hidden fields

Hidden fields are values you pass in rather than ask for, such as a campaign, a location, or a plan. Declare each one under Logic, then pass it:

  • On the survey link, as a URL parameter with the same name, such as ?location=downtown.
  • In an embed, from the URL of the page the survey runs on.

Each response saves its hidden field values, so you can read results by them. A hidden field can have a default for when the value is missing.


Answer recall

Question titles, descriptions, and ending text can fill in an earlier answer, a variable, or a hidden field. Type {{ in the field, or use the picker, and choose what to insert. The line under the field shows what will be filled in.

For example, a follow-up titled What made your visit to {{hidden:location}} great? names the location from the link.


Endings

Every survey has at least one ending. An ending is either a thank-you screen, with a title, a message, and an optional button and link, or a redirect that sends visitors to a URL. A redirect URL can include answers or variables, which are URL-encoded for you.

Visitors who finish see the default ending unless a logic rule sends them to another one. For example, send detractors to an ending that offers a callback and promoters to one that asks for a review.


Next Steps

How is this guide?

On this page