HTML Variable in email notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2015 11:30 AM
(Newbie to ServiceNow.)
Hi,
In one of my catalog items, I have a HTML variable that has a table in it. I want this HTML field to be visible in email notifications. To attempt this, I created a notification that included a script that has this in the message section (variable name of the HTML field is "move_details")
An Employee move request has been submitted.
${current.variables.move_details}
It is bringing back the variable, but all I see is the HTML tags in the email notification. How do I get the email to display the contents and not the HTML tags?
<div align="center"><table style="height: 247px; border: 2px solid black; border-collapse: collapse;" width="645"><tbody><tr><td style="text-align: center; border: 1px solid black;" width="208"><p><strong>Employee Name</strong></p></td><td style="text-align: center; border: 1px solid black;" width="208"><p><strong>Move From</strong></p></td><td style="text-align: center; border: 1px solid black;" width="208"><p><strong>Move To</strong></p></td></tr><tr><td style="border: 1px solid black;" width="208"><ol><li></li></ol></td><td style="border: 1px solid black;" width="208"><p> </p></td><td style="border: 1px solid black;" width="208"><p> </p></td></tr><tr><td style="border: 1px solid black;" width="208"><ol start="2"><li></li></ol></td><td style="border: 1px solid black;" width="208"><p> </p></td><td style="border: 1px solid black;" width="208"><p> </p></td></tr><tr><td style="border: 1px solid black;" width="208"><ol start="3"><li></li></ol></td><td style="border: 1px solid black;" width="208"><p> </p></td><td style="border: 1px solid black;" width="208"><p> </p></td></tr><tr><td style="border: 1px solid black;" width="208"><ol start="4"><li></li></ol></td><td style="border: 1px solid black;" width="208"><p> </p></td><td style="border: 1px solid black;" width="208"><p> </p></td></tr><tr><td style="border: 1px solid black;" width="208"><ol start="5"><li></li></ol></td><td style="border: 1px solid black;" width="208"><p> </p></td><td style="border: 1px solid black;" width="208"><p> </p></td></tr></tbody></table></div><div id="mceResizeHandlen" class="mce-resizehandle" style="cursor: n-resize; margin: 0px; padding: 0px; left: 358px; top: 4.5px;"></div><div id="mceResizeHandlee" class="mce-resizehandle" style="cursor: e-resize; margin: 0px; padding: 0px; left: 680.5px; top: 144px;"></div><div id="mceResizeHandles" class="mce-resizehandle" style="cursor: s-resize; margin: 0px; padding: 0px; left: 358px; top: 283.5px;"></div><div id="mceResizeHandlew" class="mce-resizehandle" style="cursor: w-resize; margin: 0px; padding: 0px; left: 35.5px; top: 144px;"></div><div id="mceResizeHandlenw" class="mce-resizehandle" style="cursor: nw-resize; margin: 0px; padding: 0px; left: 35.5px; top: 4.5px;"></div><div id="mceResizeHandlene" class="mce-resizehandle" style="cursor: ne-resize; margin: 0px; padding: 0px; left: 680.5px; top: 4.5px;"></div><div id="mceResizeHandlese" class="mce-resizehandle" style="cursor: se-resize; margin: 0px; padding: 0px; left: 680.5px; top: 283.5px;"></div><div id="mceResizeHandlesw" class="mce-resizehandle" style="cursor: sw-resize; margin: 0px; padding: 0px; left: 35.5px; top: 283.5px;"></div>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2015 11:35 AM
Have you tried this through Email notification scripts and template.print()? that should work.
http://wiki.servicenow.com/?title=Scripting_for_Email_Notifications#gsc.tab=0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2015 11:36 AM
Hi johny,
you may find the below link helpful.
http://wiki.servicenow.com/?title=Scripting_for_Email_Notifications#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2015 11:39 AM
Thanks for the reference. I am also new to scripting. Any additional details on what the script would look like?
Regards,
Johnny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2015 11:53 AM
Hi Jhony,
Here is what i did,
1) I have created a new filed in incident table called 'u_html_test'.
2) I have created Email Notification Script: Left Nav Menu->Notification Email Scripts.
3) I have included this in email notification:
Thats it, End goal is achieved. Here is the result.
Same steps on your own field and notification should work.