+ Start a Discussion
Julia ZocoloJulia Zocolo 

workflow to search string field if it contains a list of string values

Hello Developers!

We are trying to create a workflow that is searching if a title contains any of the strings we list. The issue is the below only works if that is the entire value of the string which would never happen. 

Example: Check if Job Title contains any of: Head, head of, Head of, Leader, leiter, Leiter and update Persona to "Team Head"

Formula used: 
CONTAINS("head:ho:head of:Head of:lead:leiter:leader:Projektleiterin", Title )

This works if someone's title is "Head of" but if you make it "Head of Marketing" the rule is not fired. 

Please tell me there is a way for the system to achieve this. This is a very straightforward request. In Salesforce reports, if I use Owner Role Contains "US" it correctly shows all the US Sales Reps, US Account Managers, US Customer Success Managers. 

I appreciate your time and help. 
Best Answer chosen by Julia Zocolo
AnkaiahAnkaiah (Salesforce Developers) 
Hi Julia,

Can you please try with below formula.
OR(CONTAINS(Job_Title__c,"head"),CONTAINS(Job_Title__c,"head of"),CONTAINS(Job_Title__c,"Head of"), CONTAINS(Job_Title__c,"Projektleiterin") )
If this helps, Please mark it as best answer

Thanks!!
 

All Answers

AnkaiahAnkaiah (Salesforce Developers) 
Hi Julia,

Can you please try with below formula.
OR(CONTAINS(Job_Title__c,"head"),CONTAINS(Job_Title__c,"head of"),CONTAINS(Job_Title__c,"Head of"), CONTAINS(Job_Title__c,"Projektleiterin") )
If this helps, Please mark it as best answer

Thanks!!
 
This was selected as the best answer
Julia ZocoloJulia Zocolo
Thank you!