Skip to content
  • There are no suggestions because the search field is empty.

Apply conditional logic to question groups and forms

Conditional logic allows you to show or hide questions, question groups, or forms based on how a responding organization answers an earlier question, so each organization only sees what applies to them. You can add logic inside a question group, where it travels with the group, or inside a form.

Before you start:

How conditional logic works

Every rule follows the same pattern: if a source question meets one or more conditions, then show or hide one or more targets. When a rule has more than one condition, you choose whether all of them must be met or whether any one of them is enough.

You can add logic in two places. Logic in a question group is saved with the group and goes with it into every form that uses it, which makes it a good choice when you reuse the same set of questions in several forms. Logic in a form applies to that form wherever it’s used, and a form is where a rule can show or hide an entire question group.

You can also add, edit, and remove a form’s logic while building a report on the report builder’s Add forms tab. Changes you make there also update the form in the form library.

Examples

Here are a few ways organizations use conditional logic:

If…

Then…

A question about negative incidents has an answer

Show a question asking for details about the incident

A true or false question is answered True

Hide the question group for a false response and show the question group for a true response

A net promoter score question on a 1 to 5 Likert scale is answered 1 or 2

Show questions asking for additional detail about the low score

A cash reserve amount is less than or equal to a set amount

Show a question group asking for more financial information

An organization answers Yes to a question about climate change initiatives

Show climate impact questions

Tip: If you already know which organizations should answer certain questions before you send a report, a targeted form may be simpler than applying conditional logic. See choosing between targeted forms and conditional logic.

 

Apply conditional logic in question groups

Logic in a question group can show or hide questions within that group. Because the group and its logic travel together, every form that uses the group gets the same behavior.

Add a rule to a question group

  1. In the left navigation, click Reporting > Question Library. The question library appears.
  2. Click the Question Groups tab.
  3. Click the name of the question group. The questions in the group appear.
  4. Click Edit. The question group becomes editable.
  5. Add or edit questions so the group includes the source question and the questions you want to show or hide.
  6. If the Logic panel on the right side of the screen is hidden, click the < arrow to expand it.
  7. Click Add rule, then select Show/hide question or Show/hide question group, depending on what you want to show or hide. The New rule window opens.
  8. From the If drop-down list, select the source question.
  9. From the Match drop-down list, select all conditions or any conditions. With all conditions, every condition must be met. With any conditions, one is enough.
  10. Select the condition the answer must meet. The conditions available depend on the type of the source question.
  11. Optional: click Add condition to add another condition to the rule.
  12. From the Then drop-down list, select Show or Hide.
  13. From the Pick target question drop-down list, select the question or question group to show or hide.
  14. Optional: click Add Action to add another action to the rule.
  15. Click Add. The New rule window closes and the rule appears in the Logic list.
  16. At the top of the questions list, click Save changes. A dialog shows how the change will affect other parts of reporting.
  17. Click Save. Your rule is saved to the question group.

Edit or remove a rule in a question group

  1. In the left navigation, click Reporting > Question Library.
  2. Click the Question Groups tab.
  3. Click the name of the question group.
  4. Click Edit.
  5. In the Logic list, click the drop-down arrow next to the rule. A summary of the rule appears.
  6. Hover over the summary and click the edit icon that appears.
  7. Update the rule, or remove it.
  8. At the top of the questions list, click Save changes, then click Save in the dialog.

Preview a question group’s logic

  1. With the question group open, click Preview group at the top of the group. An interactive preview opens in a new window, showing the group as responding organizations will see it, including its logic.
  2. Answer the source question in the preview to check that the right questions show or hide.
  3. Click Close preview. The preview window closes.

Apply conditional logic in forms

Logic in a form can show or hide individual questions or entire question groups. Form changes are drafts until you publish them.

Add a rule to a form

  1. In the left navigation, click Reporting > Form Library. The form library appears.
  2. Click the name of the form. The questions in the form appear.
  3. Click Edit. The form becomes editable.
  4. Add or edit questions so the form includes the source question and the questions or question groups you want to show or hide.
  5. If the Logic panel on the right side of the screen is hidden, click the < arrow to expand it.
  6. Click Add rule, then select Show/hide question or Show/hide question group, depending on what you want to show or hide. The New rule window opens.
  7. From the If drop-down list, select the source question.
  8. From the Match drop-down list, select all conditions or any conditions. With all conditions, every condition must be met. With any conditions, one is enough.
  9. Select the condition the answer must meet. The conditions available depend on the type of the source question.
    1. Optional: click Add condition to add another condition to the rule.
  10. From the Then drop-down list, select Show or Hide.
  11. From the Pick target question drop-down list, select the question or question group to show or hide.
    1. Optional: click Add Action to add another action to the rule.
  12. Click Add. The New rule window closes and the rule appears in the Logic list.
  13. At the top of the questions list, click Save question changes.
  14. To apply your changes, publish the form. See the publish and preview task below.

Note: Changes to a form aren’t applied until you publish them. Questions with unpublished changes show an (unpublished changes) tag, and the tag also appears at the top of the form.

Edit or remove a rule in a form

  1. In the left navigation, click Reporting > Form Library.
  2. Click the name of the form.
  3. Click Edit.
  4. In the Logic list, click the drop-down arrow next to the rule. A summary of the rule appears.
  5. Hover over the summary and click the edit icon that appears.
  6. Update the rule, or remove it.
  7. At the top of the questions list, click Save question changes.
  8. To apply your changes, publish the form. See the publish and preview task below.

Publish and preview the form

Once your form has the correct conditional logic applied, you must preview and publish it in order for the changes to be live.
  1. In the upper right corner, click Publish. The Publish form? dialog shows how your changes will affect other parts of reporting.
  2. Select the checkbox to confirm your changes.
  3. Click Publish form. The dialog closes and your changes are applied everywhere the form and its questions appear.
  4. Click Preview form at the top of the form. An interactive preview opens in a new window, showing the form as responding organizations will see it, including its logic.
  5. Answer the source question in the preview to check that the right questions and question groups show or hide.
  6. Click Close preview. The preview window closes.

Caution:

  • Publishing applies your changes everywhere the form is used, including reports that already include it.

  • Responses that organizations have already submitted aren’t changed.

Related articles