Mokaform

Conditional logic, variables, and hidden fields

Use Mokaform conditional logic, variables, URL parameters, hidden fields, and answer references to personalize forms.

Logic helps you ask fewer, better questions. Use it to show relevant pages, calculate scores or totals, prefill known data, and personalize messages with earlier answers.

Choose the right tool

ToolUse it forExample
Answer referencesReusing a previous answer in text"Thanks, @Name. What is your budget?"
Conditional logicShowing, hiding, skipping, or routingShow pricing questions only when someone selects "I am interested."
VariablesStoring calculated or reusable valuesLead score, quiz score, order total, selected plan label.
URL parametersPassing known data into the form link?utm_source=linkedin&company=Acme
End screensDifferent completion messagesSend qualified leads to a booking link and others to a thank-you page.

Do not put passwords, secrets, payment data, or sensitive personal data in URL parameters. URLs can be stored in browser history, analytics tools, and server logs.

Reference previous answers

Use answer references when you want the form to feel conversational.

Add the question that collects the value, such as name, company, plan, or country.

In later question text, descriptions, or completion copy, type @.

Choose the earlier field you want to insert.

Good uses:

  • Greeting respondents by name.
  • Repeating a selected product or plan.
  • Showing a selected quantity or date in confirmation text.
  • Making follow-up questions easier to understand.

Add conditional logic

Conditional logic decides what happens when answers match a rule.

Common actions include:

  • Show or hide follow-up questions.
  • Route respondents to a relevant page.
  • Send respondents to a specific ending.
  • Set or update a variable.
  • Trigger notifications only for matching submissions.

Good conditions are narrow and testable. Instead of one large rule that handles every case, use a small number of clear rules with obvious outcomes.

Use variables for scoring and totals

Variables store values that do not need to be visible as normal questions.

Common examples:

  • Quiz score.
  • Lead qualification score.
  • Product subtotal.
  • Event fee.
  • Segment name, such as enterprise, student, or high_priority.

Use variables when you need to reference the same computed value in several places: copy, logic rules, emails, webhooks, or integrations.

Capture URL parameters

URL parameters let you pass context into a form link.

https://your-form-link?utm_source=linkedin&utm_campaign=launch&company=Acme

Useful parameters:

  • utm_source, utm_medium, utm_campaign for attribution.
  • email, name, or company when sent from a CRM or email tool.
  • customer_id, plan, or segment for internal routing.

After a URL parameter is defined in the form, you can use it to prefill fields, personalize text, or power logic.

Build a simple branching form

Split the form into pages: introduction, qualification, details, and ending.

Add the question that decides the route, such as "What are you looking for?"

Create one rule per route.

Send each route to the matching page or ending.

Preview the form and test every branch with realistic answers.

Keep a test checklist next to complex forms. Branching issues usually happen because one answer path was never previewed.

Troubleshooting

What to explore next

On this page