If then otherwise

Returns one value if a specified condition evaluates to true and a second value if the condition evaluates to false.

Notes

  • The "If" condition must be a boolean condition, returning TRUE or FALSE.
  • Then/Otherwise conditions may be either text strings or numbers, but both conditions must be of the same type.

Example Use Case

A car dealer wants to inform customers whether or not their warranty is still valid when they bring their car in for repairs.

Because the "if" condition must be boolean, creating this Eligibility Rule is a two-stage process.

  1. Create an Eligibility Rule that determines whether or not the purchase date for the car was within the last 3 years. This defines the warranty period.
  2. Create an if then otherwise Eligibility Rule to return a different message to customers based on whether or not the purchase date Eligibility Rule returns TRUE or FALSE.
Note:

MXO supports nesting up to three levels of if/then/otherwise functions, inside each other, in a single expression.

If you need to nest more than three levels, we recommend splitting the if/then/otherwise functions into separate Eligiblity Rules.

Example purchase date Eligibility Rule

time between now and Purchase Date in "years" ≤ 3

Exp - if then else if condition

Example if then otherwise Eligibility Rule

if Car purchase date less than 3 years ago then Action name of repairs covered
under Warranty otherwise Action name of 10 percent Off Labour for Repairs

Exp - if then else full