Skip to main content

IFS

The IFS function checks whether one or more conditions are met, and returns a value that corresponds to the first TRUE condition. IFS can take the place of multiple nested IF statements, and is much easier to read with multiple conditions.

Use

IFS( condition1, value1, condition2, value2, ... )
Checks whether one or more logical conditions are TRUE and returns a value that corresponds to the first TRUE condition.

ParameterRequiredDescription
condition1Yeslogical condition that evaluates to TRUE or FALSE
value1Yesthe value to return if the logical condition1 is TRUE
condition2Nological condition that evaluates to TRUE or FALSE
value2Nothe value to return if the logical condition2 is TRUE
...Nomore logical conditions and values

ReturnsA value with the same type as value1

Examples

Categorizing Claim Priority

In a Variable Update formula, you can use IFS to automatically label a request based on numeric thresholds, such as the total value of an expense claim.

  • Scenario: You want to update a variable called $PriorityLevel based on the @Trigger.out.Amount.
  • Formula: IFS(@Trigger.out.Amount > 5000, "Critical", @Trigger.out.Amount > 1000, "High", @Trigger.out.Amount > 0, "Standard")
  • Logic:
    • The function evaluates the conditions in order.
    • If the amount is 6000, it immediately returns "Critical".
    • If the amount is 1500, it fails the first check but passes the second, returning "High".
    • This replaces the need for a messy formula like IF(Amount > 5000, "Critical", IF(Amount > 1000, "High", "Standard")).

Dynamic Assignment by Department

You can use IFS within an Activity Assignment formula to route a task to specific individuals based on a selection made in a trigger form.

  • Scenario: A "New Asset Request" must be assigned to different department heads depending on which department is selected in the trigger.
  • Formula: IFS(EXACT(@Trigger.out.Dept, "Finance"), { 'person:Adele Vance' }, EXACT(@Trigger.out.Dept, "IT"), { 'person:Megan Bowen' }, EXACT(@Trigger.out.Dept, "HR"), { 'person:Fred Blogs' })
  • Logic:
    • EXACT: Ensures the department text matches the criteria perfectly (case-sensitive).
    • Result: The function stops at the first match. If "IT" was selected, Megan Bowen is returned as the assignee.
    • Data Type Note: Because assignment formulas require a Person Array, the individual person literals are enclosed in curly braces { }.