Skip to main content



TableLookup Function

Returns the value from a table for the first row that satisfies the field matching criteria.

Syntax 1

TableLookup(table, returnField, matchField, matchValue)

Returns the value from a table for the first row that satisfies the field matching criteria.

Arguments

table DataElement - A table.

returnField Field - The field value to return.

matchField Field - The field to match.

matchValue Expression - The field value to match.

Syntax 2

TableLookup(table, returnField, matchField, matchValue, default)

Returns the value from a table for the first row that satisfies the field matching criteria.

Arguments

table DataElement - A table.

returnField Field - The field value to return.

matchField Field - The field to match.

matchValue Expression - The field value to match.

default Any - The default return value.

Remarks

Example:

TableLookup(OrdersTable, "CustomerID", "OrderID", ID, "City"); // returns 42

Example:

TableLookup(OrdersTable, "CustomerID", "OrderID", ID, "City", Location.City); // returns 42