Inbound action

mukkamulasagar
Giga Contributor

Hello,

I have created the Inbound Email from when an email sent from the external source the Incident and Incident task should be created, Where Incident and Incident task are getting created and according to our Classification table the Incident and Incident task also getting routed to the respective team. I tried with the field mapping in the inbound everything is populating correct. But the 'Description' is not getting populate where 'Description' is to Body text in the Email, When i populate through the script it is getting populated but remaining field maps are getting ignored and when i tried to populate all the field from the Inbound script the description is getting ignore.

 

kindly help me out.

 

Regards,

Sagar M.

2 REPLIES 2

Nawal Singh
Tera Guru

Hi @mukkamulasagar ,

I faced a similar issue, which was caused by invalid code in the 'BODY TEXT'.
I cleaned up the description, and that resolved the problem.
Try using the code below to clean the body text before using it.

 

// Input variable
  var htmlString = inputs.htmlString;
// Remove HTML tags using regular expressions

var cleanString = htmlString.replace(/<br ?\/?>|<\/p>/ig, "\n");
cleanString = cleanString.replace(/<script[^>]+>.*<\/script>/ig);
cleanString = cleanString.replace(/<style[^>]+>.*<\/style>/ig);
cleanString = cleanString.replace(/<[^>]+>/g, "");
// Output variable
outputs.text_out = cleanString;
 
Thank you!!

Ankur Bawiskar
Tera Patron
Tera Patron

@mukkamulasagar 

so the email body is to be populated in description and that's not happening?

share some screenshots and your script.

any invalid character in the email body?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader