
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2019 11:08 AM
Hi ,
Using this script :
var rec = new GlideRecord('Name_Of_App');
rec.addQuery('number=id');
rec.query();
var image='' ;
while (rec.next()) {
image= rec.attachement.getDisplayValue() ;
gs.warn("image : "+image);
}
I'm getting an .iix file outputted . I want this file to be outputted as either .png or .jpg for another operation " scan image" .
Thanks,
Salma
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2019 11:54 AM
Hi
You will not get png or jpg file
please check the sys_attachment table,here you will get all the attachment from all table.
here you can check if possibility is there to get it.
varsha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2019 11:54 AM
Hi
You will not get png or jpg file
please check the sys_attachment table,here you will get all the attachment from all table.
here you can check if possibility is there to get it.
varsha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2022 12:13 PM
Thank you for this suggestion. It worked well for me.
This was my scenario:
I am using Document Templates to generate PDF documents dynamically based on certain records. These records have images (using image fields), which must be shown on the PDF. As discussed here, the images are provided in the .iix format. Apparently, ServiceNow's PDF generator/viewer is unable to render .iix files.
The solution was to get the image from the attachment table. Interestingly, the Sys ID stored in an image field is the attachment record's Sys ID for that image. While using HTML, all I had to do was set the image source to "sys_attachment.do?sys_id=<image/attachment Sys ID>".
Example:
<img src="sys_attachment.do?sys_id=3ecd7574dbd8bb44feb1a851ca961982" />
Thanks again for your input on this.