Back

The Lookup Table extension is used to translate values based on a lookup table. For example, the Lookup Table Extension allows you to match a readable value, such as a product's name, to that product's ID number.

See the full list of available extensions.

In this article:

Table of Contents Placeholder

Prerequisites

  • This feature requires utag v4.38 or higher.

How it Works

If your system contains a list of product IDs, it may be difficult to determine what product references which product ID. The Lookup Table extension allows you to match a readable value, such as a product name, to that product ID’s number.

In this case, the Lookup Value would be the product ID, and the destination would e the product name. When the extension runs, it looks for the product’s ID variable and populate the product name variable with the corresponding product’s name.

Using the Extension

Before you begin, familiarize yourself with how extensions work.

Once the extension is added, the following configuration options are available:

  • Lookup Value in: Select the variable that contains the value you want to look up.
  • Destination: Select the target variable to hold the output value you specify. Click on the + button to create new output variables.
  • Variable Type: Specify whether the value you're looking up is a string or an array. If you select array, any output goes into the same array index as its corresponding Lookup Match.
  • Match Type: All lookups are done using the selected match type.
    • Exact: If the value is exactly what you specify in the Lookup Match field.
    • Contains: If the value contains something you specify in the Lookup Match field.
    • RegExp: Run a regular expression you specify against something in the Lookup Value field. If you have special characters that you need to escape with a backslash "\", use two backslashes "\\". The ignore case "i" flag is applied automatically.
  • Lookup Match: Enter the precise value you're looking for in the Lookup variable. Do not enter quotes in here.
  • Output: Enter the value you wish to place/overwrite in the Destination when the lookup match is found. Do not enter quotes in here.
  • Note (optional): Add notes pertinent to each Lookup match and output value. The content of the Note is not passed to the destination.
  • Default Output: If the lookup match is not found, the Destination is replaced by this default value instead of the original Output. If you don't wish to apply a default value, check the "Disable Default" box to disable it.

The following table explains how the destination changes in relation to the variables and the default value .

  Default Output is populated Default Output is blank
Lookup and Destination are unique Destination value is replaced by the default value Destination value is left blank
Lookup and Destination are identical Both lookup and destination values are replaced by the default value Lookup and destination values are NOT replaced.

Import from CSV

To enter large numbers of lookups, use the "Import from CSV" feature. Enter the CSV (comma-separated value) formatted text in the order of Lookup Value, Output value and corresponding Notes. The Lookup Value is entered into the Lookup Match field and the corresponding output value is entered into the Destination field.

One example of a lookup-output value pair is product IDs linked to product names. A product might have an ID of "123" and a name of "LED TV". Another product might have and ID of "789" and a name of "Plasma TV". In both these situations, the value of the lookup-output pair is the product's ID, while the value of the lookup-output pair is the English-readable name of the product.

To add lookup-output values in bulk:

  1. Click the Import from CSV button.
  2. Enter in the CSV-formatted data in the order of: Lookup Value, Output value, Notes.
  3. You may either add to or replace the existing lookup table.
    1. Click Append to add to the existing table.
    2. Click Replace to replace the existing table.

bulk_lookup.png

Export to CSV

This feature exports the Lookup Values into a CSV file. Enter the values for Lookup Match, Output, and Notes in their respective fields and click the Export to CSV button. At least one instance of lookup match, output, and note value is required to perform a successful export. If all the three lookup fields are blank, data is not exported.

This feature is compatible with most modern browsers, with the exception of IE. If you are using Firefox or Chrome, the values are directly exported into a lookup.csv file. In a Safari browser, the CSV-formatted values are exported into a new browser tab instead of a .csv file.

lookup.png

Examples

Implementing the Lookup Table

You have a list of product IDs in your system. However, you find that looking at product ID numbers gives you a headache. When you look at the ID number, you don't immediately know if it corresponds to a Blu-ray player or a bag of kitty litter. The Lookup Table Extension allows you to match a readable value, such as a product's name, to that product's ID number.

  1. From the Lookup Value in drop-down menu, select the variable whose value to look for, in this case the product_id.
  2. From the Destination drop-down list, select the variable to place the new value, in this case product_name.
  3. In the Default Output field, enter "none" indicate when the product_id value doesn't contain any information.
  4. In this scenario, the product_id variable only contains one ID per product, so select string for Variable Type.
  5. For Match Type, select "Exact" if you know the exact product IDs.
  6. Now we're going to add the lookups to match product IDs to product names.
    1. In the Lookup Match field, enter the first product's ID, which is "123".
    2. In the Output field, enter the product's name, which is "Sony LED TV".
    3. Add relevant notes in the Note field.
    4. To add another Lookup, click the + button next to the existing Lookup entry.

Add more Lookups, matching the product_id "456" to "Sony Blu-ray Player" and "789" to "Panasonic Plasma TV". Add relevant notes for the lookups.

lookuptable.png

Now, when the Lookup Table extension runs, it looks for the product IDs in the product_id variable and populate the product_name variable with the corresponding product name.