How would I get an attached image from the catalog item to show in the body of the email?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 01:34 PM
Hi All,
I am working on a Catalog item that has an attachment variable. When the catalog item is submitted, it's suppose to send an email with all the variables in the form, including the attachment. I am using flow designer. I know how to have the image attached to a email but I want to know if it's possible to have the image in the body of the email along with all the other variables in the catalog item.
How would I get the attached image from the catalog item into the body of the email?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 02:10 PM
Hi,
You can accomplish this by creating a mail script with code such as:
template.print("<img src=/sys_attachment.do?sys_id=" + current.variables.name_of_attachment_variable + ">");
So for example, I have a catalog item with an attachment variable like so:
Label is: Attach image and variable name is: attach_image
So I created the mail script and replaced "name_of_attachment_variable" with the name of the variable and then associate that mail script in the body of the notification such as:
And then when it's sent, it'll look like this:
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 02:57 PM
Hi,
I actually just finished writing an article about how to do this since I felt it was useful information and others may benefit as well: https://community.servicenow.com/community?id=community_article&sys_id=de11582ddb46c514fd63250913961...
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!