Hi, I would like to be able to check if an extraction contains specific words. Currently I have an if statement searching the string for various substrings, but this does not search for the exact word so could find the string within another word. My current if statement is below:
var result;
var field = record.fields.Address_SubField1;
if (field.includes(“January”)) {result=“”;}
else if (field.includes(“February”)) {result=“”;}
else if (field.includes(“March”)) {result=“”;}
else if (field.includes(“April”)) {result=“”;}
else if (field.includes(“May”)) {result=“”;}
else if (field.includes(“June”)) {result=“”;}
else if (field.includes(“July”)) {result=“”;}
else if (field.includes(“August”)) {result=“”;}
else if (field.includes(“September”)) {result=“”;}
else if (field.includes(“October”)) {result=“”;}
else if (field.includes(“November”)) {result=“”;}
else if (field.includes(“December”)) {result=“”;}
else if (field.includes(“Dear”)) {result=“”;}
else {result=field;}
result;
I sure this is possible but I cannot work out how. Any help would be greatly appreciated.
Thanks