Answers/Can I add conditional logic to forms?

Can I add conditional logic to forms?

Updated March 2026

Yes. Sutrena supports showIf conditional logic on any field. Add showIf: { field: "role", equals: "other" } to a field definition, and that field only appears when the dependency field has the specified value.

This works on both hosted forms at /f/{id} and custom frontends. On hosted forms, the field is hidden/shown automatically. On custom frontends, read the form definition and implement the same logic in your UI.

Server-side validation is aware of showIf. If a required field is hidden because its dependency condition is not met, validation skips it. You do not need to make conditionally-hidden fields optional.

Example: a select field "role" with options ["Developer", "Designer", "Other"] and a text field "role_other" with showIf: { field: "role", equals: "Other" }. The text field only shows up — and is only required — when "Other" is selected.

showIf handles simple field-level visibility. It is not a multi-branch wizard or a deeply nested dependency chain. One field depends on one other field's value. For complex multi-step flows, build your own frontend logic.

Ready to build?

Get a trial API key instantly — no signup required.

Conditional logic in forms — Sutrena | Sutrena