Do UI only formulas support something like "Case" in salesforce formulas?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I need look into a long text field and determine if a any words from a list are contained in the long text.  I can do this using a UI only formula field for one word, but what would be the best way to compare it to a list? Salesforce Formula fields have a "Case" function, but it can't be used on Long Text Fields.  I don't see a Case type of option in UI ONLY forumlas. Is it possible?
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 18,326 Points 10k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 54,246 Points 50k badge 2x thumb
Official Response

In Skuid's Q4 release we are adding some new Formula Functions that should help with this: CONTAINS_ANY, CONTAINS_ALL, and CASE

CONTAINS_ANY will allow you to check whether a given input string contains any of a list of other strings, e.g.

CONTAINS_ANY({{Favorite_Food__c}}, "Spaetzle", "Sauerkraut", {{Dynamic_Food_Choice__c}})

CONTAINS_ALL() will allow you to check whether a given string contains ALL of a list of other strings.

And the CASE() statement is a convenience method to avoid a million nested IF() functions, e.g.

CASE({{Status}}, 0, "Open", 1, "In Progress", 2, "Closed", "Invalid Status")

to replace

IF({{Status}} == 0, "Open", IF({{Status}} == 1, "In Progress", IF({{Status}} == 3, "Closed", "Invalid Status")))