how can i check particular string in body of email inbound email action

Pradeep J
Kilo Guru

Hi All,

I am using the below line to check the particular word is present in the body of email.

email.body.contain("Certified")

if Certified word is present then i need to update the status as Certified.

Am I using the correct keywords ? If not please help

Thanks

Pradeep D J

18 REPLIES 18

Manoj Kumar16
Giga Guru

You can use-



current.email.body_text.indexOf("Certified")>-1



to check whether the email body contains word "Certified" or not


Here I am attaching the snapshot.



I am applying the line of code in the condition.



Capture.PNG



according to condition when email body contains the word certified then it should set the status field.



But it is working for all reply emails. Even email body doesn't contain the certified word


Pradeep J
Kilo Guru

email.subject.startsWith("chg:")



Above line I found in Serviceow Wiki.



is there any way which check for contains in email body






Manoj Kumar16
Giga Guru

email.body_text should work. Its working in my personal instance.



Can you please paste the code you have written ?


Here I am attaching the snapshot.



I am applying the line of code in the condition.



1.PNG



2.PNG



according to condition when email body contains the word certified then it should set the status field.



But it is working for all reply emails. Even email body doesn't contain the certified word