Setting up a form with conditional logic

This new feature is being piloted. Help us improve it — Give feedback

Conditional logic changes what people see when they fill out a form, depending on their previous answers. This improves the experience, especially when the form is long or complex. Splitting online forms into multiple pages and applying conditional rules can help make it easier and quicker to fill out. This means it’s possible to ask some questions only when relevant or to route people down different paths. As a result, the quality of data collected often also improves.

There are two types of conditional logic now available in GC Forms. 

  • Display logic: to show a question dynamically as a follow-up based on a specific answer being selected.
  • Branching logic: to route people through different flows based on the answer selected.

To allow for branching logic, we’ve added pages as a new feature that allows you to structure your form, with groups of questions that are displayed together.


Creating a multi-page form

GC Forms now allows you to create multi-page forms. Online forms typically work best when they ask about one thing per page. Focusing on one topic or question at a time helps lower the cognitive load experienced by people filling out the form. This can make the form less overwhelming and easier to understand and navigate.

Adding a new page:

  1. Create a form in GC Forms.
  2. Open the “Form set-up” panel on the right side of the screen.
  3. Navigate to the “Pages” tab within the panel. From here, you can add a “New Page”.
    • New pages will be added after the Start page (first page of your form by default, which includes the introduction and privacy statement) and prior to the Review page (where people filling out the form will be able to check their answers before submitting their response), and finally the Confirmation page (which appears once a form is submitted).
  4. Give your page a name for internal reference and a page title which will be displayed to the people filling out the form.
  5. In the “Pages” tab, drag and drop questions and pages to reorder and reorganize your form. 
  6. In the “Form set-up” panel, navigate to the “Branching” tab to visualize the entire form flow and connections between pages at a high level.
Screenshot of the GC Forms interface editing a form with multiple pages. The Form set-up panel on the right shows an outline of all pages and, if expanded, the form elements within them. The Start page and Confirmation page are esssential parts of the form that are present by default.

Applying display logic to a form

Display logic uses “if”/”then” or “show”/”hide” rules to dynamically show questions based on previous answers selected by people filling out the form. Currently, this is available for form elements with selectable options, such as radio buttons, checkboxes, and dropdowns.

  1. Create a form in GC Forms.
  2. Add a form element that allows you to select an option, such as radio buttons, checkboxes or dropdown list.
  3. Add multiple options to the question selected.
  4. Add another form element that will be dependent on choosing a specific answer above.
  5. Select the option to associate with a conditional display.
  6. Go to “Add a rule”.
  7. In the “Add a display rule” modal, select which option, if answered, will decide if the subsequent question appears.
  8. Select which question will show on selection and save.
  9. Add as many rules as is relevant.
    • You can also use the shortcut “Add Other option” to insert a conditional text input field when “Other” is selected by the person filling out the form.
Screenshot of the GC Forms interface editing a form with display logic. The question with a choice of radio buttons has a rule so that if people opt in to be contacted, they get a subsequent question asking for their email address.

Applying branching logic to a form

Branching logic gives you the ability to take people down different paths within the form depending on their answers. You can create multiple separate flows splitting out form content to show people only the pages that are relevant to them. Currently, this is available for forms with more than one page. Just like display logic, branching is a function of form elements with selectable options, such as radio buttons, checkboxes, and dropdowns.

Adding branches to route people filling out the form down different paths

  1. Create a form in GC Forms.
  2. Add a form element that allows you to select an option, such as radio buttons, checkboxes or dropdown list.
  3. Add multiple options to the question selected.
  4. Add a subsequent page to your form that will be the destination when choosing a specific option above.
  5. Open the “Form set-up” panel on the right side of the screen.
  6. Navigate to the “Branching” tab.
  7. Select an option (indicated with the green bent arrow icon).
  8. Select “Add a rule” to split the flow based on the option and take people to a specific page based on its selection.
  9. Make sure to test all branching paths before publishing to ensure the form works as expected. You can test your form by going to the preview option called “Test” in the side navigation. 
    • Should your branching pattern get messy and convoluted, you can remove all branching by resetting to a linear flow. You can find this option in the “Branching” tab of the “Form set-up” panel.
  10. Branching allows you to create parallel flows that will ultimately lead to the Review page to submit the form and Confirmation page afterwards.
    • If you wish to have people exit the form flow earlier when ineligible to continue, you can convert a page to an “exit page” in the flow, by selecting the the purple right arrow icon in “Branching”. You’ll be able to customize the exit page content in “Pages”.
Screenshot of the GC Forms interface editing a form with branching logic. The visualization shows different paths someone might take depending if they answer email, phone, or opt out, which sends them to a separate exit page.



Date modified: