Conditional logic can be used to simplify your forms for clients. You can show or hide questions (or even sections) based on other responses. This can be helpful when you have questions that don’t apply to all types of events (e.g. wedding ceremony questions, details about addons, performances, details about venues, etc).
High-level Concepts
The logic used by Lumify is a variant of an Expression Language, which enables human-readable phrases to be interpreted by machines. While that sounds complex, it’s not as hard as it looks.
In short, form conditional logic is a set of rules that either “show” or “hide” a question (or section) depending on the result of the logical expression (whether it resolved to true). If a question is hidden by default, you can define “show” logic that will determine when (or if) a question is displayed. Alternatively, if a question is shown by default, you can define “hide” logic that will determine when (or if) a question is hidden.
Example
Let’s say you have a Wedding Planning Form that contains a section called “Ceremony Details” but you don't do ceremonies for all weddings. But you'd like that section to show when you're providing sound for the ceremony.
In this case, you can hide the section called “Ceremony Details” and add a "show logic" rule. The show logic rule will be based on a prior question: “Are we providing sound for your ceremony?” If the answer to that question is “Yes,” then the “Ceremony Details” section will be displayed:
Show “Ceremony Details” section if: select1 == "Yes"
The reference to select1
represents the field ID of a prior question which asks “Are we providing sound for your ceremony?”
If the value of select1
is blank or "No", then the “Ceremony Details” section will not be shown.
Available Operators
There are a number of comparison, arithmetic, and logical operators available to use with conditional logic.
Comparison Operators
- ==
- ===
- !=
- !==
- <
- >
- <=
- >=
- matches
Logical Operators
- not
- and
- or
Array Operators
- in
- not in
Arithmetic Operators
- +
- -
- *
- /
- %
- **