0

In a workflow rule I need to check for specific strings within a text field. A simple substring match using "contains" cannot work as it would lead to ambiguity, I put the strings inside of quotation marks. Now the criterion should match the substring including the quotation marks.

Specifically I need a criterion that matches the current user's role. So the role name would be "something 'exact string' some more". My rule should therefore be

Current user: Role  contains  'exact string'

If I enter into the field 'exact string' and save the criterion, it results in

Current user: Role  contains  exact string

basically turning back to the simple substring. If I enter ''exact string'' the resulting rule looks okay. It actually reads

Current user: Role  contains  'exact string'

but the criterion is never met. Within code you would of course use the backslash to escape the quotation marks, but that does not work in these rules either.

How can I have a workflow rule criterion match strings including quotation marks?

  • It would be help full for you salesforce.stackexchange.com/questions/165231/… – Pavan tej Sep 13 '17 at 13:51
  • Thanks, but not really. In this case the quotes are the first and the last character of the filter. But when saving, the quote marks are removed from the criterion. 2 consecutive quote marks result in single quote marks, yet the rule does not match. – Florian Heer Sep 13 '17 at 14:00
1

You can use "formula evalutes to true" and then use this formula: CONTAINS($UserRole.Name, '"exact string"')

screencast

  • Thank you! I never thought to open that drop down, just tried to somehow get the criteria to match. – Florian Heer Sep 13 '17 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.