- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2020 03:47 AM
Hi All,
We have a requirement to display an image in email body (Not as attachment). Image displays properly when i preview email in service now but image is not seen in customer mail box.
Below is the logic currently used in email script - url is reference to sys_attachment table where image is located.
<img src=' + url + '>'
This is not able to fetch image from sys_attachment & load it on to email.
Kindly let me know how to implement this scenario.
Thanks.
Regards,
Anil KP
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2020 04:31 AM
Better create a business rule on insert on Attachment table when content type is Image/JPEG that copies the attachment to image (db_image) table & then use the above script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2020 03:52 AM
Hi Anil,
You may find the below thread helpful.
https://community.servicenow.com/community?id=community_question&sys_id=3cd43ec8dbb87b08a39a0b55ca96...
Hope this helps!
Please mark the reply as Helpful/Correct, if applicable.
Regards,
Hemant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2020 06:00 AM
Hi Hemanth, db_image works fine but can you please guide to insert on image field of db_image table from sys_attachment. I tried couple of ways but it is copying as attachment to db_image not to field.
thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2020 03:58 AM
Hi Anil,
Try using below in your mail script.
var img = "/ImageName.png"; //give the imagename that is uploaded in image table along with format
var instance = gs.getProperty("instance_name");
var link = "https://" + instance + ".service-now.com";
template.print('<img src="' + link + img + '">');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2020 04:20 AM
Hi Jaspal ,This is exactly what i'm doing - i can only see in service now instance preview. but its not bringing image on actual email.
attachment = sysId_of_image;
var url = gs.getProperty('custome_url') + "/sys_attachment.do?sysparm_referring_url=tear_off&view=true&sys_id=" + attachment ;
template.print(ind.getMessage("Customer Signature ", lang) +' '+ '<img src=' + url + '>' + "<br><br>" );