Skip to main content



Lookup Functions

Returns the value from a table for the first row that satisfies the filter.

Syntax 1

Lookup(table, returnField, filter)

Returns the value from a table for the first row that satisfies the filter.

Arguments

table Table - A table.

returnField Field - The field to return.

filter Expression - The filter criteria.

Syntax 2

Lookup(table, returnField, filter, default)

Returns the value from a table for the first row that satisfies the filter.

Arguments

table Table - A table.

returnField Field - The field to return.

filter Expression - The filter criteria.

default Any - The default return value.

Remarks

Example:

Lookup(OrdersTable, "CustomerID", "OrderID=" & ID& " AND Region='CENTRAL'"); // returns 42

Example:

Lookup(OrdersTable, "CustomerID", "OrderID=" & ID& " AND Region='CENTRAL'", -1); // returns -1