Conditional Forms
Learn how to build a conditional form.
Conditional Forms include all the features of Basic Forms but are enhanced with advanced functionalities like Step Logic, Section Logic and Dropdown option filtering (based on logic). These features enable the forms to adapt in real time to the attributes or input of your form users, creating a tailored form-filling experience.
Building a Conditional Form
Setting up a Conditional Form involves the same initial steps as setting up a Basic Form. Here’s a quick recap:
- Add a form block preset: From your Softr app, add a new form block to your page.
- Select a destination: A destination can be a data source, email or a tool like Zapier or Make.
- Add questions: Add and map the required fields into your form such as Name, Email, Message, etc.
Step logic
Step logic allows you to guide users through specific steps of a form based on their inputs or predefined user attributes. Here’s how to implement it:
- Add steps: Break your form into multiple steps or pages.
- Set conditions for paths after a step: Specify conditions under which a user should be directed to a particular step. For example, if a user selects "Yes" to needing additional services, you can set the form to navigate to a step that gathers more detailed information about their requirements.
- Test step logic using preview mode: Ensure that each pathway functions as intended by testing each conditional route to catch any errors or logical inconsistencies.
Section logic
Section logic enhances the adaptability of forms within individual steps:
- Add sections: Divide your form into sections within a single step, grouping related fields together.
- Apply conditions to sections: Configure each section to show or hide based on user responses or attributes. For example, a section asking for payment information can be hidden unless the user selects a paid service.
- Dynamic sections: You can make sections dynamically appear as more information is required or certain conditions are met, improving form engagement and preventing information overload.
Dropdown options filtering
Dropdown options filtering allows you to conditionally display specific values in a dropdown field based on certain criteria. This is particularly useful when you want to guide users to select only relevant options.
Linked record option filtering
Imagine you have an event registration form connected to your "Registrations" table, which in turn is linked to an "Events" table. Each event in your data source might have a status of either 'Upcoming' or 'Past'. To prevent users from registering for 'Past' events, you can filter the dropdown to only show 'Upcoming' events. Here’s how to set it up:
- Add the dropdown field: Insert a dropdown field in your form and map it to the 'Event' field, which is a linked field from the "Registrations" table.
- Access the option filter: Click on the logic icon next to the “Options” label. This will open the option filter panel.
- Apply the conditional filter: Toggle on the "Filter options by condition" setting and add a condition. For this example, you’ll filter by
Status is Upcoming
.
With this setup, the dropdown will only display 'Upcoming' events for users to select, ensuring that they can’t mistakenly register for past events.
This example demonstrates how to filter linked record options.
Option value filtering
You can also apply filters based on the option values themselves, providing flexibility for different scenarios. For instance, imagine you have an email field in your data source that’s mapped to a dropdown field. If you only want to display email addresses that belong to a specific domain, such as '@softr.io', you can filter the dropdown options to show only those emails. This ensures that users are restricted to selecting emails that match the specified criteria.
Last updated on August 21, 2024