Inbound Action: email.body_text and HTML
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2017 07:09 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2017 07:17 AM
Hi Jamie,
What do you mean by RAW HTML.
Can you show us some screen shots.
Thank you,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2017 07:39 AM
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).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2017 07:42 AM
HI,
Did you tried.
email.body.text;
Thank you,
Ashutosh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2017 07:45 AM
Hi,
You can also just try email.body.
please use of log statements to see what it is returning to you.
Thank you,
Ashutosh