IF
Use the IF function to return one value if a condition is TRUE and another value if it's FALSE.
Use
IF( condition, value_if_true, value_if_false )
Returns the first value if the logical condition is TRUE otherwise return the second value.
| Parameter | Required | Description |
|---|---|---|
| condition | Yes | the logical condition to evaluate |
| value_if_true | Yes | the value to return if the logical condition is TRUE |
| value_if_false | Yes | the value to return if the logical condition is FALSE |
| Returns | A value with the same type as value_if_true |
Examples
Variable Update for Automated Status Labeling
You can use the IF function in a Variable Update Formula to categorize a request based on numeric thresholds, such as an expense claim amount.
- Scenario: You want to update a variable called
$ReviewTypeafter a trigger form is submitted. If the claim amount is over $500, it is labeled "High Level"; otherwise, it is labeled "Standard". - Formula:
IF(@Trigger.out.ClaimAmount > 500, "High Level", "Standard"). - Logic: The function evaluates the output
ClaimAmount. If the condition is met, the variable stores the first text string; if not, it stores the second. This variable can then be displayed in a Content Block to give reviewers immediate context.
Conditional Activity Assignment
You can use an IF function within an Activity Assignment Formula to dynamically choose which group receives a task based on a selection made in the trigger form.
- Scenario: A user selects their department from a dropdown. If they select "Finance," the activity is assigned to the Finance group; otherwise, it goes to the General Admin group.
- Formula:
IF(EXACT(@Trigger.out.Dept, "Finance"), { 'group:Finance' }, { 'group:GeneralAdmin' }). - Logic:
EXACT: Ensures a case-sensitive match for the department name.{ 'group:...' }: Wraps the group literal in curly braces to ensure the formula returns a Person Array, which is required for assignment formulas.- Result: The activity is routed to the correct team automatically based on the "Finance" condition.