Skip to main content
Version: 7.9


This function is used by Ignition's Expression language.


This expression is used to swallow errors caused by other expressions. The first expression will be executed, and if it executes successfully, its value will be used. However, if there is an error evaluating it, the value of failover will be used. When the failover is used, the data quality will be set by the failover value. It is best to use a very simple return like -1 or "" (the empty string).


try(expression, failover)

  • Parameters

    • object expression - An expression that can evaluate to anything.

    • object failover - The value to use if there is an error in the expression parameter.

  • Results

    • object - The result of the expression or the failover value if there is an error.


Code Snippet
try(toInteger("boom"), -1) // returns -1 with a quality code of 192 (good)
Code Snippet
// fetch an integer value from the first row of a table. Return -1 if there are no rows
try({Root Container.Power}[0, 'Integer Column'], -1)