Skip to main content
Version: 8.1


This function is used by Ignition's Expression language.


This looks for lookupValue in the lookupColumn of dataset. If it finds a match, it will return the value from the resultColumn on the same row as the match. If no match is found, noMatchValue is returned.


The type of the value returned will always be coerced to be the same type as the noMatchValue.


lookup(dataset, lookupValue, noMatchValue, [lookupColumn], [resultColumn])

  • Parameters

    • Dataset dataset - A dataset to search through.

    • Object lookupValue - The value to look for.

    • Object noMatchValue - The result value if no match.

    • Object lookupColumn - The column to lookup. Can either be the column index or the name of the column. Defaults to 0. [optional]

    • Object resultColumn - The column to pull the result value from. Can either be the column index or the name of the column. Defaults to 1. [optional]

  • Results

    • Object - The value in the result column of the same row that the lookupValue was found, or the noMatchValue if a match was not found. The data type of this object will always be coerced to match the type of the noMatchValue parameter.


The examples are based of a table that has the following data in it:

Code Snippet
lookup({Root}, "Carrots", -1.0) //returns 3.50
Code Snippet
lookup({Root}, "Grapefruit", -1) //returns -1, the noMatchValue
Code Snippet
lookup({Root}, "Walnuts", "Unknown", 0, "Category") //returns "Nut"
Code Snippet
lookup({Root}, "Pecans", "Unknown", 0, 2) //returns "Unknown", the noMatchValue