A Singapore Government Agency Website

Add form logic

Form logic sets conditions that show extra fields or display messages when an applicant enters certain values. Use it to ask for more information only when needed. Use it to warn applicants about a consequence, or to stop an incomplete or invalid submission.

Who this applies to

  • Audience: Configurators.
  • Access required: The View and Edit permissions on the scheme.
  • Assumed knowledge: The form already has the components that the logic refers to. Refer to Add components to a form.

Logic types

Logic type What happens when the condition is met Blocks routing?
Show Fields Extra fields appear to request more information. No
Show Warning Message A warning appears. Use it to tell the applicant about a possible consequence before they continue. No
Show Error Message An error message appears. Use it to stop a submission from moving forward. Yes
Show Error Banner Message An error banner appears. Use it to stop a submission from moving forward. Yes

Steps

  1. In the Form Builder, select the Logic tab.
  2. Add a new logic.
  3. Choose the logic type.
  4. Write the condition in the IF box. You can use the preset conditions in the next section.
  5. Save the logic.
  6. Test it in the preview. Refer to Preview a form configuration.

Preset conditions

In the conditions below, TargetField is the field that the logic applies to.

Components Check Condition
Date The date against today. TargetField = today()
Multi-selection, Radio question, Single selection All options are included. has(TargetField,"Option 1","Option 2")
Multi-selection, Radio question, Single selection At least one option is included. any(TargetField,"Option 1","Option 2")
Aggregate, Calculated, Checkbox, Conditional, Date, Multi-selection, Numeric, Radio question, Single selection, Text The input matches a regular expression. match(TargetField, "Regex expression")

For ready-made regular expressions, refer to Regex patterns.

Constraints and limitations

Constraint Detail
Blocking logic Error messages and error banners stop a submission from moving forward. Warning messages do not.
Calculated dates Calculated date and duration fields can be used as conditions in logic.
After publishing You cannot change logic directly after publishing. Create a new version. Refer to Change a scheme after go-live.
Chat with me!
Bot Launcher