Skip to main content

LOOKUPEX

The LOOKUPEX function is used to look up a value from a dynamic data source, such as an Excel sheet, CSV file, or a Data Sync project. This function is similar to the LOOKUPA function.

The LOOKUPEX function takes three parameters: columnName, which is the name of the column to retrieve from the data source, from, which specifies the data source to retrieve the data from (using one of the FROMEXCEL, FROMCSV, or FROMDATASYNC functions), and keyValues, which is a key/value object used to specify the conditions for retrieving data from the data source.

Syntax

object LOOKUPEX(string columnName, LFROM from, params KVAL[] keyValues)

Example

Looking up a Name from an Excel Spreadsheet

Suppose you have an Excel spreadsheet containing data about suppliers, and you want to retrieve the Name of a supplier based on their ID. You can use the LOOKUPEX function with the FROMEXCEL function to accomplish this as shown below:

LOOKUPEX("Name", FROMEXCEL("filePath"), KV("ID",ID))

In this example, the LOOKUPEX function is used to retrieve the Name from the Excel spreadsheet based on an ID value. The FROMEXCEL function is used to specify the data source to retrieve the data from. The KV function is used to specify the condition for retrieving data from the data source, you can also use WHEN as an alternative.

Looking up a Name from a CSV file

Suppose you have a CSV file containing data about products, and you want to retrieve the Name of a product based on its ID. You can use the LOOKUPEX function with the FROMCSV function to accomplish this as shown below:

LOOKUPEX("Name", FROMCSV("filePath"), KV("ID",ID))

In this example, the LOOKUPEX function is used to retrieve the Name from the CSV file based on an ID value. The FROMCSV function is used to specify the data source to retrieve the data from. The KV function is used to specify the condition for retrieving data from the data source, you can also use WHEN as an alternative.

Looking up a Name from a Data Sync project

Suppose you have a Data Sync project containing data about customers, and you want to retrieve the Name of a customer based on their ID. You can use the LOOKUPEX function with the FROMDATASYNC function to accomplish this as shown below:

LOOKUPEX("Name", FROMDATASYNC("filePath"), KV("ID",ID))

In this example, the LOOKUPEX function is used to retrieve the Name from the Data Sync project based on an ID value. The FROMDATASYNC function is used to specify the data source to retrieve the data from. The KV function is used to specify the condition for retrieving data from the data source, you can also use WHEN as an alternative.