Create a workflow If statement to look for sub string in a string

Peter Williams
Kilo Sage

Hi everyone,

 

how can i program this better, i want to be able to convert the string into lowerCase and then search for the lowercase sub sting in the If Statement

 

PeterWilliams_0-1709144620173.png

 

1 ACCEPTED SOLUTION

 

 

If condition updated.

make sure the variable afa returning string type value [ not an object type ]

in case, afa is returning Object, then add .toString().toLowerCase();

 

 

answer = ifScript();
//
var proBono = current.variables.afa.toLowerCase();
function ifScript() {
if (proBono.indexOf('pro bono') > -1 ) {
return 'yes';
}
return 'no';
}

 

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

View solution in original post

7 REPLIES 7

Peter Williams
Kilo Sage

getting an error message on the workflow when i am testing it

 

error must be about toLoweCase();

 

try with toString().toLowerCase(); 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

no luck still getting the error message