Skip to main content

LookUp - script function

This script function returns the value of fieldname corresponding to the first occurrence of the value matchfieldvalue in the field matchfieldname.

Syntax:  

lookup(fieldname, matchfieldname, matchfieldvalue [, tablename])

 

The search order is load order unless the table is the result of complex operations such as joins, in which case the order is not well defined. Both fieldname and matchfieldname must be fields in the same table, specified by tablename.

If no match is found, NULL is returned.

Arguments:  

Argument Description
fieldname Name of field to return value. Input value must be given as a string (for example quoted literals).
matchfieldname Name of field to lookup matchfieldvalue in. Input value must be given as a string (for example quoted literals).
matchfieldvalue Value to lookup in matchfieldname field
tablename

Name of table. Input value must be given as a string (for example quoted literals).

If tablename is omitted the current table is assumed.

Example:  

LookUp('Price', 'ProductID', InvoicedProd, 'pricelist')

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!