Skip to content
🚀 Rapid Application Development with the App Builder

Lookups

Lookups can be used to replace codes and IDs with meaningful values from a lookup table. A lookup must return a single, unique value.

Base Table

The base table is the table queried in the app. The screenshot below shows raw data from the tutorial_emp table returned by the SQL Query Builder. This table contains a deptno column, which holds a department number. Without a lookup, an app user would only see this number, which is not meaningful on its own.

WP Data Access - Base Table

Lookup Table

The tutorial_dept table contains a department number (deptno) and a corresponding department name (dname) for each department. A lookup uses this table to replace the department numbers in the base table with their meaningful names.

WP Data Access - Lookups Table

📌 The red arrows in the screenshots above point to department number 30, which the lookup will replace with SALES.

> A lookup example that uses the same table for both the base and lookup source is available here.

⚙️ Creating Lookups

The screenshot below shows the deptno column from the tutorial_emp table. The column label has been changed to Department, but since no lookup is defined yet, the raw department numbers are still displayed.

Clicking the START LOOKUP WIZARD button allows us to create a lookup for column deptno.

WP Data Access - Lookups Table

1 - Select Database

Select the database where your lookup table is stored.

WP Data Access - Creating Lookups - Step 1

📌 The lookup table does not need to be in the same database as the base table.

2 - Select Lookup Table

Select the lookup table. In our example, this is the tutorial_dept table.

WP Data Access - Creating Lookups - Step 2

3 - Select Lookup Column

Select the column in the lookup table that corresponds to the column in the base table you are replacing.

WP Data Access - Creating Lookups - Step 3

📌 In this example, the deptno column from tutorial_dept corresponds with the deptno column from the base table.

4 - Select Lookup Column Values

Select the column value(s) you want to display. You can choose more than one column. Use the column delimiter field to define a separator between values.

WP Data Access - Creating Lookups - Step 4

5 - Lookup Conditions

Add any additional conditions to filter the lookup results. This is useful if you store multiple types of lookups in a single table. You can add a WHERE clause to limit the rows returned.

WP Data Access - Creating Lookups - Step 5

📌 Dynamic conditions are primarily relevant for forms. They allow lookups to update interactively based on user input.

FINISH

  • Click the FINISH button to complete the lookup creation.
  • Click APPLY or OK to enable the lookup.

📌 Enable load full lookup table on startup to reduce server load.
📌 Reload your app if the lookup values do not appear immediately.

Final Table Layout

The screenshot below shows the result after applying the lookup. The department name SALES is now displayed instead of the department number 30.

WP Data Access - Lookup Values In Table