Inbound Action: email.body_text and HTML

Jamsta1912
Tera Guru

Hello all,

I have an inbound email action set up against the incident table.

I'm populating the 'description' field using this:

current.description = email.body_text;

Standard so far, and I have a number of other inbound actions doing the same thing.

However, in this particular case the description field is being populated with the raw HTML of the inbound email, rather than just the actual text.

Any suggestions on why this might be happening?

Jamie.

18 REPLIES 18

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi Jamie,



What do you mean by RAW HTML.



Can you show us some screen shots.



Thank you,


Ashutosh


Hi Ashutosh,



If we send an email with this in the body to our ServiceNow instance:




This is a test




we see this in the email log in ServiceNow as the body:




<html>


<head>


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>


</head>


<body dir="ltr">


<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">


<p style="margin-top:0;margin-bottom:0">This is a test</p>


</div>


</body>


</html>




and email.body_text will return "This is a test".




But in this case, email.body_text is not extracting the text from the HTML, instead it's returning the whole body (HTML tags and all).


HI,



Did you tried.


email.body.text;



Thank you,


Ashutosh


Hi,



You can also just try email.body.



please use of log statements to see what it is returning to you.



Thank you,




Ashutosh