This function evaluates the expression condition, and returns the value of trueReturn or falseReturn depending on the boolean value of condition. Can be nested in one another to make provide multiple layers of logic


if(condition, trueReturn, falseReturn)

  • Parameters

object condition - The condition to evaluate.

object trueReturn - The true return value.

object falseReturn - The false return value.

  • Results

object - Returns the trueReturn if the condition is true, falseReturn if it is False.



 if(1, "Yes", "No") //would return "Yes"


 if(0, "Yes", "No") //would return "No"


 if({Root Container.CheckBox.selected}, "Selected", "Not Selected") //would return with a description of the state of the checkbox


 if({tag1} > 10, if({tag2} > 20, "Both Tags are greater.", "Tag 1 is greater."), if({tag2} > 20, "Tag 2 is greater.", "Neither Tag is greater."))
//nests if functions to check the value of 2 different Tags, and return a message based on which ones are greater than a setpoint.