Support conditional CASE statements in SFM Formulas

Support conditional CASE statements in SFM Formulas

Currently, the only conditional operators supported are: IF, OR, AND, NOT.

The idea is to support the CASE function in the same way it works with salesforce, e.g.

CASE(expression, value1, result1, value2, result2, ... , else_result)

Checks an expression against a series of values.  If the expression compares equal to any value, the corresponding result is returned. If it is not equal to any of the values, the else-result is returned

So my use case would be to pre-populate a damage code group based on the type of equipment selected. Attempted some psuedo code below!

CASE ( Field=Equipment Type,

Value 1 = Cooler,           Result = Cooler Damage Code Group CSR-41,

Value 2 = Fountain ,      Result 2 = "Fountain Damage Code Group CSR-31" ,


But with the current SFM Formulas, I have to use nested IF statements, which get very messy and hard to read very quickly. Example from what i built in my SFM:

$F.IF( $F.EQUAL($D.Case.Equiment_Type__c, "COOLER"), "CSR-41", $F.IF( $F.EQUAL($D.Case.Equipment_Type__c, "FOUNTAIN"), "CSR-31", null ) )

Thats only for two equipment types, we have over 20....

Therefore if SFM formulas could support CASE statements in a similar way to how salesforce supports them in their formulas, it would make this much easier to implement. It would need to support this in the mobile apps to be useful for us.

What is the underlying problem do you intend to solve with this idea?
Complex logic within SFM formulass
How is the problem being addressed today, if at all?
Using nested IF statements.
Product Area?
Mobile Field Service Management Work Order Management
What version of ServiceMax are you on?
Summer 16
1 Comment
Product Team
Product Team

tushar sharma​ - for your review and consideration.