Automation and AI

Conditional logic

Conditional logic means a form behaves differently depending on what was entered, for example sending a submission to a different person or tool based on one of the answers.

Also called: conditional routing, form routing, run conditions

The term covers two different things, and it helps to keep them apart.

Conditional fields

On the form itself, a field appears only when an earlier answer calls for it: “Other” reveals a text box, “Yes” reveals follow-up questions. This keeps long forms short for the visitor and happens in the browser.

Conditional routing

After the form is sent, the answers decide what happens next. A department field set to “billing” goes to the billing mailbox, a priority of “critical” also pings the on-call channel, a newsletter checkbox adds the visitor to a list. This runs on the server and saves someone from sorting messages by hand.

Typical uses

  • Send each department’s enquiries to its own inbox.
  • Alert a chat channel only for urgent messages.
  • Call a webhook only when a box is ticked.
  • Attach a file to an email only when the visitor uploaded one.

In StaticForm

Routing is built from run conditions. Every submit action (email, webhook, Slack, Google Sheets and so on) can carry one or more conditions that compare a submitted field with a set of allowed values. The action runs only when all its conditions are met, and an action without conditions always runs. Add three email actions with a condition on department and each department gets its own copy of the right messages. Conditional routing is part of the Pro plan, and each email attachment can have its own send condition too. Conditional fields on the form itself are built in your own HTML and JavaScript.

Learn more