What is Conditional Logic?

Imagine you’re looking at a car dealership website online. In their search form, you select “Toyota” as the make. A new box pops up labeled “Model,” with Prius, Sienna, Rav4 and so on. Select the model, and another new box pops up with options for trim specific to that model.

You’ve just encountered conditional logic. In broad terms, conditional logic is any system of rules designed to execute different actions based on whether certain conditions are met. In website design, it’s used to create websites and forms that can dynamically respond to interactions by automatically triggering actions when conditions change.

Conditional logic offers a more convenient and streamlined experience for your site visitors. Here’s what you should know about conditional logic, including how it works, why it’s useful, and how you can start using it for your web pages and forms.

How does conditional logic work?

The most basic form of conditional logic, the IF statement, is also a good way to understand the rules more generally: IF statements, and conditional logic in general, dictate that if a condition is met, then the program should execute a specific response.

Other interactions conditional logic can build include ELSE and SWITCH statements.

  • ELSE statements provide alternative actions if another IF statement is unmet. For example, if a website wants to deny access to people under 21, it might ask users to input their date of birth when they first land on a page. The IF statement would dictate that, if the user inputs a date of birth that makes them 21, then the site would give them access. The ELSE statement would activate if the user is less than 21, sending the user to a page informing them they can’t access the rest of the site. You could also use ELSE IF statements to add multiple additional conditions.
  • SWITCH statements evaluate an expression against multiple possible use cases at once and execute one or more blocks of code based on the use case the condition matches. For instance, if a programmer wanted a webpage to display unique content depending on the day of the week, then when the webpage loads, the SWITCH statement would check the date and execute the code containing the appropriate content. You can even program switch statements with built-in defaults in case none of the conditions accounted for are matched.

How conditional logic supports improving customer experiences

Conditional logic can allow you to make forms and web pages that are much more efficient and user-friendly. By providing options based on conditional logic, you can expedite user journeys through your content. And, in the case of forms, you can obtain more specific and useful information about the person filling out the form, and faster than you might otherwise be able to.

For example, by using conditional logic to supply different responses to users based on their initial answers, you can very quickly personalize the form-filling experience for that user. They’ll spend less time filling out your form and provide you with more information at the same time. The faster and more specific your forms, the lower your bounce rate will tend to be.

You could even use conditional logic to expedite agreement completion. For example, Docusign Web Forms allow you to use conditional logic to dynamically adapt form fields with previous information, reducing the need to ask your users redundant questions.

How to use conditional logic in forms

Here are just a few ideas for how you can start using conditional logic to make your forms much more user-friendly and efficient:

Funnel users to the most relevant information

Start your forms by asking questions to help narrow down what your users are looking for. Conditional logic can help you supply this information much faster. For example, if you use forms for new account openings, the first section of your form might ask users which of your services they intend to use.

When the user supplies this information, a simple conditional logic interaction could automatically ensure that all the follow-up questions/sections would only ask questions relevant to the services they’re interested in. 

Customize response recipient

Using conditional logic, you can easily add a section to your forms dictating where any information the user sends you goes within your organization.

For example, if you’re creating a form for users with questions about your product, you could add a section asking them where they would like to direct their questions. Include each relevant department (Billing, IT, Sales, etc.) as a possible answer to that section and attach the appropriate contact’s information to that answer. When a user selects that department and submits their form, it will automatically go to the right department to answer the question.

Automate submission organization

Conditional logic is a great way to automatically sort form responders into relevant categories. This can help you organize your lead database and make sure the right information gets to the right teams as quickly as possible.

Start by defining categories within your database. For example, if age demographics are very important to you, then you could ask a question about age on your form. Then, when a respondent fills that form, you could use conditional logic to automatically send their form information to the appropriate age category within your database. Your organization will know that any lead that filters to that area of your database is pre-qualified for whatever information you are organizing for, allowing them to prioritize who to reach out to based on it.

Conditional logic is a system of rules for coding languages, but that doesn’t mean you need to know how to code to make use of it. DocuSign Web Forms streamline the process of using conditional logic, giving you all the options without any of the coding.

If you’re interested in using conditional logic to improve your forms, DocuSign is ready to help.

Published
Related Topics