Lookup field
Lookup fields allow your form users to select or look up values from a nominated data source within Snapforms while submitting their answers.
Featuring a range of Lookup field types and optional settings, lookups can easily be configured to cater for different data input requirements.
For example, you can use a Lookup field to enable form users to look up specific details (such as an employee ID) and pre-populate related details from a separate source form (for example, their name, email address, department, and more).
Types of lookups
There are three types of lookups that allow form users to look up values in different ways:
Lookup Type | Description | Example |
Specific Value | The form user enters a specific value to perform the lookup.This lookup supports automatic population of other fields in the same form when looking up a specific value. | |
Auto-Suggest | The form user is presented with suggestions of possible values while typing.
This lookup supports automatic population of other fields in the same form when a value is selected from the list. |
|
Drop-down List | The form user selects from a drop-down list of all possible values.
This lookup type supports two functions:
|
Using lookups
In most scenarios, using a Lookup field will require two forms:
- the source form that acts as a centralised database for collecting and storing the data values, and
- the master form where the lookup is performed.
Create a database using a source form
Firstly, you will need to create a source form that will be used to collect and store the required data that will be referenced by the master form.
- Create a new form, e.g. Staff ID Database
- Add all the fields your database requires.
- Save and view form.
Alternatively, if the lookup data is all contained within the same form, you can skip to adding a lookup field to your form.
Note: Email Address and Address field types are currently not supported in the Lookup feature. We recommend using Short Answer fields in your source form instead.
Collect data
In our example below, we’ve created a source form called ‘Staff ID database’ which we will use to collect employee information.
Data can be collected via manual entry of forms, bulk CSV upload (contact Snapforms support to enable), or API.
To collect data via manual entry:
- Complete the fields in your source form.
- Click Submit.
- Repeat above steps for each new entity.
View/edit form submissions
If you need to review or edit submitted responses, go to Dashboard > your source form > View Responses.
Create your master form
Now, it’s time to build the form that will be used to perform the lookups and receive form responses. This form will contain the Lookup field(s) that will reference the source form.
- Create a new form, e.g. Staff Register.
- Add a Lookup field to your form, e.g. Staff ID Lookup.
- Select the lookup type, e.g. specific value.
- Select the Source Form, e.g. Staff ID Database.
- Select the Source Field, e.g. Staff ID.
- Use the lookup options to configure how you want the lookup to function.
- Add any additional fields that may be required for populating matching fields after lookup or for cascading lookups.
- Save and view form.
Tip: We recommend using the same field names as your source form to ensure successful field matching when using lookups to auto-populate other fields in your master form.
Lookup options explained
Lookup option | Tick this if you want to… |
Automatically populate other fields after lookup | Automatically populate the fields in your master form (that match the source form) when the lookup is performed.
In the example below, when a form user looks up a Staff ID, the next four fields (First Name, Last Name, Email, and Department) will automatically populate with the corresponding data values for matching fields in the source form. |
Answer must exist in the lookup source | Ensure the lookup answer corresponds with an existing data value in the source form responses. |
Hide lookup result message | Hide the result message when the form user (successfully or unsuccessfully) performs a lookup in the master form.
|
Enable ‘Fuzzy search’ to increase results by adding close matches. | Increase search results by including close matches (applies to auto-suggest lookups only)
|
Cascade filter answers based on another lookup field | Create a tiered hierarchy of two or more dropdown list lookup fields (such as categories and subcategories) where a form user’s selection in one lookup field will determine the list of options in another lookup field.
For example, if a form user selects ‘Freezers’ in a field called ‘Category’, the next field ‘Subcategory’ will display a filtered list of options for that category, e.g. ‘Chest’, ‘Upright’, and so on. |
Use cases
If you’re interested in learning how lookups could be used in your organisation, please head over to our lookup examples: