Using conditional logic and validation for forms

Get ready to level up your Forms! We'll show you how to add conditional logic to make your forms smarter, implement validation to ensure accurate data, and seamlessly create attributes in the Hub for better data organization. Let's take a look!

Adding conditional logic

To add conditional logic to your form, select LOGIC & VALIDATION in the bottom right-hand corner of your question block.

Conditional logic allows you to add rules to your questions, or more specifically, conditional logic is the visibility of a question block based on a responder's answers. For example, if a responder answers that they shopped online, you can then hide all questions related to in-store experience.

Adding validation

To add validation to your form, again, select LOGIC & VALIDATION in the bottom right-hand corner of your question block.

Validation allows you to set rules around what kind of inputs will be accepted by your form. For example, the email address field requires answers to contain @ and .com before the answer will be accepted. If the answer doesn’t contain these validators then an error message will appear.

Lexer tip!
You can create custom error messages for your forms, or use the default set by Lexer.

Associated attribute

As well as logic and validation, you’ll also find the Associated Attribute section here.

What this section displays is either the new attribute that will be created from this question, or the standard attribute that the data from this question will flow in to. You will then be able to access this attribute in your Hub.

For example, you could create a multiple choice question that asks “What’s your favorite ice cream flavor from our new range?” The Associated Attribute would then be What’s your favourite ice cream flavour from our new range? and you would find this attribute and the associated data in Segment.

Lexer tip!
There are some exceptions to this, for example “Address”. If a responder answers three separate questions: Street Name / City / Country, then you would have three associated attributes. One for Street Name, one for City, and one for Country. Email is another exception, the Associated Attribute would just be Lexer’s standard “Email” attribute even if the question is phrased differently, for example, “What is your email address?”

What's next?

Lexer’s Form Builder is the ultimate way to create forms and surveys to capture zero-party data directly from your customers. To learn more about access and pricing, you can find more detail here. If you would like any help, reach out via the chatbot in the bottom right hand side of the page. We have heaps more content that showcases Lexer's Form Builder. You can see the full list of Forms content here.

August 8, 2023
Did this page help you?
Thank you! Your feedback has been received!
Oops! Something went wrong while submitting the form, for assistance please contact