Lookup Tables
Lookup tables provide a way to map values from one domain to another within Inspire. They are useful for translating codes to labels, mapping IDs to names, or defining status-to-colour mappings.
Creating a Lookup Table
- Navigate to Data Sources > Lookup Tables
- Click New Lookup Table
- Give it a name (e.g. “Status Colours”, “Region Names”)
- Add entries as key-value pairs
Example: Status Colours
| Key | Value |
|---|---|
ok | #27ae60 |
warning | #f39c12 |
critical | #c0392b |
unknown | #95a5a6 |
Example: Country Codes
| Key | Value |
|---|---|
GB | United Kingdom |
US | United States |
DE | Germany |
FR | France |
Using Lookup Tables in Formulas
Use the lookup() function to reference a lookup table:
lookup("Status Colours", status_field)This returns the value from the “Status Colours” table that matches the current value of status_field.
With a default value
lookup("Status Colours", status_field, "#cccccc")If no matching key is found, the default value #cccccc is returned.
Using Lookup Tables in Data Bindings
When binding an element property in the Designer:
- Click the link icon next to a property
- Choose Formula
- Enter a
lookup()expression - The property value is resolved through the lookup table at render time
Common Use Cases
| Use Case | Lookup Table | Usage |
|---|---|---|
| Colour-code statuses | Status to colour hex code | Bind element fill colour |
| Translate codes | Code to human-readable label | Bind text content |
| Map icons | Category to icon name | Bind icon property |
| Localise text | Key to translated string | Multi-language displays |
Managing Lookup Tables
- Edit — Click a lookup table to modify entries
- Import — Upload a CSV with key-value columns
- Export — Download as CSV for backup or editing
- Delete — Remove a lookup table (check formula references first)
Last updated on