Specific Value Lookup Example: Staff ID Lookup
In this Lookup field example, we needed an efficient and accurate method for adding staff information to one of our HR forms.
We were able to achieve this by using a specific value lookup field and linking it to a separate source form that contained the staff information. This allowed form users to look up a specific staff ID, which then auto-populated the related details from our source form, i.e. name, email address, department.
The following provides an overview of the form fields and settings required to create this type of lookup.
The source form
Firstly, we created a data source that will provide the staff information for the lookup in our HR form.
We created a basic source form called ‘Staff ID Database’ with the following fields:
- Staff ID (Short Answer field)
- First Name (Short Answer field)
- Last Name (Short Answer field)
- Email Address (Short Answer field)
- Department (Dropdown List field)
To prevent entry of duplicate Staff ID numbers when this information is collected, we enabled the ‘Do not allow previously entered value’ option in the Staff ID field’s Advanced Options.
Collect data
We used this form to create a simple database of our staff by submitting the required details for each staff member.
Tip: For large volumes of data, please contact Snapforms Support and request bulk uploads to be enabled.
You can check and edit the submitted information via the Form Responses List.
The master form
After completing the source form, we added the following fields to the HR form where the lookups will be performed:
- Staff ID (Lookup field)
- First Name (Short Answer field)
- Last Name (Short Answer field)
- Email Address (Short Answer field)
- Department (Dropdown List field)
When a form user looks up a Staff ID, we want the next four fields (First Name, Last Name, Email, and Department) to automatically populate with the corresponding data values from the source form database.
The table below shows the Lookup field settings that are required to achieve this.
Field/Option | Settings |
Lookup Type | User enters a specific value to perform the lookup. |
Source Form | Staff ID Database |
Source Field | Staff ID |
Automatically populate other fields after lookup | Enabled Tip: We recommend that you use the same field names as your source form to ensure successful field matching when using lookups to auto-populate fields in your master form. |
Answer must exist in the lookup source | Enabled |
Hide lookup result message | Disabled |