MyRapidi
MyRapidi

Search our Wiki

CASE

The ##CASE formula is used to evaluate an input value against a series of cases (conditions) and return a corresponding result. It's similar to a switch-case statement in programming or a series of if-else conditions, providing a compact and readable way to map values.

The syntax would be : ##CASE (fields, value1, result1, value2, result2, default result);

Example:


##CASE("Departmentcode", 'East', 1, 'Vest', 2, 'North', 3, 99)


Formula breakdown:

  1. "Departmentcode": The value being evaluated (e.g., a department code string).
  2. Cases and Results:
    • 'East' → 1
    • 'Vest' → 2
    • 'North' → 3
  3. Default Result: 99 (returned if none of the cases match).

The ##CASE formula can be also used in combination with other formulas such as ##DBLOOKUP, #ISEMAIL, #ISPHONE, etc. Here are a couple of additional examples:


##CASE(ISEMAIL("E-Mail"),1,"E-Mail",SKIPFIELD())
##CASE(ISPHONE(PrimaryContactPhone),1,PrimaryContactPhone,SKIPFIELD())