- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 10:23 AM
Hi team,
I just imported images using a zip file attachment into db_image table.
We also have a Images table in our scoped application with an image field and some additional metadata.
Now that I imported the images, how can I assign an imported image to a Image field in my application?
I looked into the Image field documentation : Add an image field , but found no instructions to do that.
Maybe I can use GlideRecord api?
Please help.
Kind regards.
-
Eduardo
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 01:52 PM
Hi Team,
After doing some additional research I found the solution which I will share for the benefit of the community:
How to Copy One image(Field 1) to another image(Field 2) both fields are of Image type
Basically we can use GlideSysAttachment to link an image imported in db_image table to an existing IMage field in any scoped application table.
var ga = new GlideSysAttachment();
var attachments = ga.copy('db_image', yourImageAttachment.sys_id, 'ZZ_YYx_your_table',row.sys_id);
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 10:38 AM
eg: if i create an field (image type) on incident table then if you will upload the image that will save into incident table.
i think you can query those file and write after business rule to update it in db_image table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 11:06 AM
@harsh_vardhan Do you have sample code, as this is binary information and I have no experience with binary information, what is the API call for that?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 11:11 AM
I did not try. i can have look and will get back to you.
by the way you can refer the link below .
Talk:Scripting of Field Types - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 02:00 PM
Hi @harsh_vardhan in the link you provided I can read " There is no API for scripting them, just as with attachments." , however this post is from 2012, 5 years ago, is this affirmation still true? Kindly please advise.