A lookup is a list of possible allowed values for a specific column. These values are referenced from a separate table called a lookup table.
For a fixed number of values, this can be achieved using the enum data type.
To create a lookup, start the lookup wizard and follow the instructions. A lookup must return a single unique column value.
To see a detailed step-by-step on how to use the Lookup Wizard, please see: Lookup Wizard
Lookups support single selections only. For multiple value selections, use the set data type.
Example #
Consider table products containing a product type column. Available product types are stored in a table product_types.
create table product_types
(product_type varchar(10) NOT NULL
,product_info varchar(255) NOT NULL
,...
,PRIMARY KEY (product_type)
)
create table products
(product_id int NOT NULL
,product_type varchar(10) NOT NULL
,...
,PRIMARY KEY (product_id)
,FOREIGN KEY (product_type)
REFERENCES product_types(product_type)
)
Start the lookup wizard #
- Select your database
- Select lookup table `product_types`
- Select lookup column `product_type`
- Select `product_info` (or other(s))
- Add lookup conditions (if applicable)
Notes #
- Step 4 allows you to add multiple lookup columns to the list. A column delimiter can be added between the selected columns. Columns added in step 4 are included in the search on the lookup table.
- Additional lookup conditions are not necessary if you want to show all available lookup values. Use the Default where clause if you want to show a subset of the lookup values.
- Dynamic conditions can be used to make the list output depend on other form values. Use dynamic conditions to create cascading drop-down lists.