Form Conditional Logic
  • 15 Nov 2023
  • 7 minute read
  • Dark
    Light
  • PDF

Form Conditional Logic

  • Dark
    Light
  • PDF

Article Summary

Conditional logic filters are available throughout all forms. Conditional logic filters are used to conditionally show fields & prompts based on previously captured data. Fields and prompts can be conditionally shown three ways:

  • By section: Show a section of fields using section breaks. Filters are placed on each section break start.

  • By field: Show a field using conditional logic filters within each individual field.  

  • By prompts: Show a prompt using conditional logic filters within each individual prompt value.

There are times when certain responses on a form might require follow up questions to gather additional information. There are also times when a response is necessary for one population of people filling out the form, but not others. Conditional logic can allow for a hyper-personalized experience when filling out forms. 

Best Practice

Use a logical order on the form. Conditional questions should generally appear immediately after the preliminary question. The student should never have to “scroll up” to respond to a previously hidden question.

Be cautious: conditional logic can unset a record's fields

When you hide a field using conditional logic, you tell Slate that the values for that field should not exist on records that don't meet the conditions in which the field would appear.

For example, say an appliant selects biology as their major, and that choice conditionally displays the concentration field microbiology. Later, the applicant changes their major to history. Their choice of concentration, which existed on the condition that their selected major was biology, is removed from their record. Since the student no longer qualifies for the conditionally suppressed field of microbiology when their major changed, the value should not exist.

This example illustrates the intended use for conditional logic. When you use conditional logic to simply hide certain questions, it leads to the unsetting of fields that should still retain their values. Be conscious of how you are using your conditional logic to set various fields. If you find yourself wanting to conditionally set a default value field, we recommend setting that value via Rules.

Important!

Add conditional logic last! It's important that the pillars of the form be built prior to adding any layers of conditional logic. Jumping into conditional logic first and/or along the way can unnecessarily complicate the building of a form.

Conditionally Show a Section of Fields

To conditionally display a section of fields:

  1. Start by adding a grouping of fields that will show together.

  2. Drag in one section break. Place this section break at the beginning of the section that will conditionally show together.

  3. Drag a second section break. Place this section break at the end of the section that will conditionally show together.

  4. Double click the first section break and add conditional logic filters to define the population that should see the section.

  5. Do not add any filters to the second section break.

Changing the settings on a section (including setting its status to "inactive") applies until the beginning of the next section. If no other section follows, the changes apply to the remainder of the form.

Examples

Applications: Material Uploaders

Does the application require different groups of materials based on the population to which the applicant belong? For instance, Mechanical Engineers must upload one set of documents while Biomedical Engineers must upload entirely different documents.

Form / Events Registration

Does the event form provide a different experience if the student is interested in applying as a Freshman versus a Transfer? Use Conditional Logic Filters to show entire sections for specific populations.

Form / Events Registration:
Decision Reply

Does the reply form provide a different experience if the student accepts an offer of admission versus declines an offer of admission? Use Conditional Logic Filters to show one section for those who have accepted, and a second section for those that have declined.

Not seeing your filter?

Filter options are automatically populated based on the form fields. Form fields populate the filter options if they meet the following criteria:

  • The form field uses prompts

  • The data type is set to one of the following: Date/Time, Date, Int, or Real

  • The form field must have a label or export key

Free-text form fields that do not have one of these data types are not eligible for filtering since there is no meaningful way to filter on free text data in this context. All form fields are available for selection with the 'Form Field Exists' filter. This filter looks for the presences of a response for the selected form field.

Form Filters vs. Other Filters

Form Filters

Use form filters for conditional logic driven by real time responses to fields on the form.

Prospects / Applications / Slate Template Library Filters

Use these types of filters for conditional logic driven by responses to data points previously captured. Example: A process might call for a field to show based on the Round chosen. Round was selected prior to navigating to this form page. Use the Slate Template Library filter for Round Key.

Conditionally Show a Field

To conditionally show a field:

  1. Start by adding a fields that will show.

  2. Add conditional logic filters to define the population that should see the field.

Examples

Applications: "Have you
previously applied?"

If the applicant responds 'yes' to this question, a  field would display conditionally for date entry.

Form / Events Registration:
"Will you join us for lunch?"

A commonly asked question is "Will you join us for lunch?" If the response is yes, a second commonly asked question might appear conditionally that asks if there are any dietary restrictions to know about.

"Do you have any dietary restrictions that we should know about?" If there is a restriction that is not listed as a prompt, the student might select a prompt value of "Other". By clicking "Other", the student would be presented with a free text field to explain the restriction. This text field would be hidden for all other prompts.

Form / Events Registration:
"How did you hear about us?"

A commonly asked question is "How did you hear about us?" If there is an avenue that is not listed as a prompt, the student might select a prompt value of "Other". By clicking "Other", the student would be presented with a free text field to explain how they heard of the institution. This text field would be hidden for all other prompts.

Conditionally Show Prompts

To conditionally display prompts:

  1. Select the field that contains prompt values that will conditionally appear based on Degree selected. 

  2. Select Edit Prompt Conditions.

  3. Select an individual prompt. If there are many prompts that will contain the same logic, check multiple prompts.

  4. Add Conditional Logic Filters to the prompt(s)

Examples

Applications

Major selection is driven by the Degree selected. Shows majors that the applicant can select from that are only available based on the selection of a specific Degree.

Form/Event Registration

Academic Interest is driven by degree sought selection. Shows academic interests that the applicant can select from that are only available based on the selection of a specific Degree chosen.

Tip!

Prompts with logic will have a status of 'Has Logic'.

Changing the Form

Remember that any changes that made to a form could alter the behavior of conditional logic. For example, imagine a event registration form includes an unmapped field that asks if a prospective student is staying for lunch on an event registration form. Based on their selection of "Yes", a "Dietary Preference" field appears. 

If the "Yes" value is changed to something like "Yes, I Will stay for lunch", the conditional logic that configured on the Dietary Preference field will stop working. The filter on the "Dietary Preference" field must be updated to displayed based on a response of 'Yes, I will stay for lunch.' in the "Will you be joining us for lunch?" field.

When editing a form field that is referenced in a conditional logic filter, an alert message will display that reads: "This field is used elsewhere on this form to control the visibility of other fields..."

  • Remember to always add conditional logic last to avoid having to alert messages as shown above. Additionally, always test the entire form after making changes to ensure that the form still behaves as intended.

  • When prompt conditions exist, Slate follows certain logic to show or hide the entire form field based on whether there are any available prompts. As a result, Prompt logic should not be added to Hidden fields, as it can override the Hidden setting.

Checking Conditional Logic

A comprehensive list of all logic included on a form can be viewed in Show Form Logic. Field, prompt, and section logic, along with calculation formulas can be viewed here.

To view a form's conditional logic:

  1. Click Edit Form.

  2. Click Show Form Logic / Fields. This will list all prompt logic, field logic, section conditions, and calculation formulas present on the form.

  3. To check the logic, click Run Field Tests.

logic.png

Green arrows and red X's will appear under each instance of form logic to illustrate potential errors in the logic or calculation formula. The presence of a red likely indicates one of the following:

  • Filters are arranged incorrectly (e.g. a closed parentheses but no open parentheses)

  • An OR is out of place

  • A filter is referencing a field not on the form

  • A calculation syntax error exists

The Check Logic will not check individual prompt logic for a record. Instead, it is recommended to check that logic in a query or fill out the form with a test record.


Was this article helpful?