Understand lookup field
The lookup field enables you to create a relationship between forms. Using this relationship you will be able to lookup data from another form in the same application or from a form in a different application in your Zoho Creator account. This mapping of data is done using the record ID. Each record that you add using your forms will generate a record ID, which serves as a backend reference to accomplish data sync. When you are filling a form, the lookup field will show the list of values or records that have been added in the related form. And when you choose a value and submit the current form, a mapping is established between both the forms and this mapping of data is done using the record ID.
Let's assume you are a law firm and you have a Legal Case Management application to run your business. The app has modules to store and view data on your lawyers, clients, cases that your firm is engaged in, case details, case histories, hearing details, payment details, and more.
The three important modules of this app would be:
- a Lawyer form to capture all details of all the lawyers associated with your firm
- a Client form for your client details
- a Case Details form to capture details about the lawyer or lawyers handling the case, the client, and information on the case like documents related to the case, the payments made, and more
This Case Details form includes lawyer and client information which has already been captured in the Lawyer and Client forms. Instead of adding two new fields for Lawyer and Client you can add a lookup field in the Case Details form, through which you will be able to access the data in the other two forms and reuse them here, thus avoiding redundancy of data and fields.
Other advantages of using a lookup field
Lookup field helps you with:
Lookup field traits
When you add the lookup field to your form, you need to do the following. Learn how to add a lookup field
Define the Relation : Here you select the form that you want to establish a relationship with
- You can create a new relationship or a unidirectional relationship, or
- You can use an existing relationship, to create a bidirectional relationship. Learn more
Set the Display Type : This defines the way in which the looked-up data will be displayed when your users access this lookup field, and the numbers of values your users will be allowed to select — one or many.
- Dropdown : The looked-up data will be displayed in a dropdown, and your users will be able to select one value
- Radio Button : The looked-up data will be displayed as radio buttons, and your users will be able to select one value
- Multi Select : The looked-up data will be displayed in a drop-down menu, and your users will be able to multiple values
- Checkbox : The looked-up data will be displayed as checkboxes, and your users will be able to multiple values
Customize lookup's display fields
You can customize the manner in which the related form's records are displayed by your lookup field. You can have the lookup field display the data stored in one field of the related form, or from multiple fields. When you select multiple fields, you can define if any separator is to appear between the field values. Learn how
The lookup field can display data from the following types of field : name, address, email, phone, single line, number, percent, currency, decimal, auto number, radio, drop down, date, date-time, formula, users, ID, added user, modified user, added time, and modified time.
Note: You can add only upto four display fields for your lookup field.
Allow new entries through the lookup field
There can be instances where the data (in the related form) that a user wants to look up, is not present in it. Instead of making the user access the related form, then add the required data, and then look it up from your form, you can enable them to add records to the related forms via the lookup field itself. Learn how to enable this
After enabling the Allow new entries property of the lookup field, below is what a user will experience upon accessing your form:
- The Add New Entry option will be displayed by the lookup field as the last choice
- Clicking or tapping it will open the related form in a pop-up window, where you can enter and submit the required data
- The entered data will be added to the related form, and will also be selected in the lookup field
Filter the records that the lookup field displays
By default, the lookup field displays all the records present in the looked-up form. However, you can apply a filter based on data in the looked-up form. Learn how
The filter you set will be applied every time your users access the lookup field, both while adding and editing a record.
Other field properties