The lookup field is used to access data from your datasets in order to autopopulate information into your form.
As an example, let’s say you are filling out a purchase order for a regular vendor. Rather than typing in all the fields, it would be great to auto-populate the vendor information.
Creating the dataset
To do this, you first need a dataset that has all of your vendor information. You can create your own dataset or download a template from the marketplace.
In this example, the dataset has these fields: Name of the company, Nature of business, Contact person, and Phone number.
Configuring the Lookup field
In your form, create a lookup field called Name of the company. This will be the field that causes the others to pull up the correct data.
Under Choose a flow to look up, select the dataset that has your vendor information.
Then under Select all fields that will be used by this process, you need to select all the fields you plan to use at any time in your form.
The next section says Hide fields from displaying during selection. Here, you can limit the fields that show when making the initial lookup. If you don’t select this one, then in the live form, all the fields will display like this:
If you hide all the other fields except for the name of the company, then only the name and the Key field will show.
Adding auto-populating fields
Now add the other fields you want to auto-populate as text fields.
Where it says Is this a computed field?, move it to Yes.
The formula you will use is:
[name of the lookup field ID].[name of the field in the dataset]
For this field, the formula is:
Do the same for all the other fields.
The live form
Back in the live form, when you choose the company name, all the other fields will automatically show up.
Using a Lookup field within a table in a form
If you are using a lookup field inside a table, the rows in the column will show the Key value or in case a Key is not available, the first field value that was selected. If the first field value is not defined, then it is shown as <field_name>: undefined. Clicking the row will display all the values of the selected fields.