How Does Conditional Logic Work?
What Can I Use Conditional Logic For?
- Showing / hiding Fields Based on the Value of Other Fields
- Adding Email Recipients
If the user checks the option FeedBack for our field Issue Type, we notify feedback@mycompany.
- Adding Tags to Submissions
If the user checks the option FeedBack for our field Issue Type, we add the tag feedback to our submission.
- Setting the Redirection Path
Based on the user selection, we can redirect the user to Thank You Page 1, or Thank You Page 2.
- Automatically Triggering Form Submission
- Triggering an Integration
If the user checks the option Send Me Updates, we add his email to our MailChimp list.
How Does It Work?
We can add logics using the Conditional Logic button on our form builder menu.
Note that when we add a Logic, it has two parts:
- and their actions
Basically, conditions allows us to define when to invoke the action. To invoke the action(s) listed under and their actions, all the conditions must be fulfilled.
We have a field in our form which asks the user for their Operating System (Your OS). If the user selects Mac, we show a field which asks for Mac Version. If the user selects Windows, we show a field which asks for Windows Version.
- Firstly, we edit the Mac Version and Windows Version fields, and check the option Hidden. We do this to make sure both fields are hidden when the form loads.
- Next, we add these two conditional logics:
Let us add a checkbox field labelled Issue Type, with three possible options: Complaint, Feedback, Sales
We will need three logics for our form:
- If the issue is Complaint, we notify email@example.com, add the tags complaint and unresolved to our submission, and redirect the user to http://example.com/help/faq
- If the issue is Feedback, we notify firstname.lastname@example.org, and redirect the user to http://example.com/thank-you
- If the issue is Sales, we notify email@example.com, and add the tag important
To achieve this, we would add the following three conditional logics:
That's it. Now close the dialog, and test the form.