/
try

try



Function: try()

Evaluates an expression and returns its value unless an error has occurred. If an error occurs, the error value is placed into an internal variable called _error and the 2nd expression is evaluated.

Syntax

try(expression1, expression2)

ArgumentTypeDescription
expression1ExpressionAny valid expression
expression2ExpressionAny valid expression


Examples

The first expression tries to convert crm.total to a number. If the conversion fails, the reason for the failure is stored in the internal variable _error. This value, along with a value from the in pipe is stored in the user defined $SysError variable, and a value of -1 is returned.

try( 
   $val = toNum(crm.total), 
   do( 
      $SysError = _error + in.accountKey, 
      -1 
   ) 
)


See Also

Related content

matches
matches
Read with this
try
More like this
Using Actionflow Phases
Using Actionflow Phases
Read with this
try
More like this
systemError
systemError
Read with this
try
More like this