
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2020 01:40 AM
I have an image stored in db_image table.
Now from the work flow, I want to attach it as a attachment to a particular Request.
How can I achieve this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2020 02:10 AM
Hi there,
When adding a new image db_image, note automatically a sys_attachment record is created:
Knowing this, with GlideSysAttachment you could copy the attachment record. Use the table_name and table_sys_id of the record you are after. See this docs page about GlideSysAttachment: https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=r_SGSA-GlideSysAttachment
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2020 02:10 AM
Hi there,
When adding a new image db_image, note automatically a sys_attachment record is created:
Knowing this, with GlideSysAttachment you could copy the attachment record. Use the table_name and table_sys_id of the record you are after. See this docs page about GlideSysAttachment: https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=r_SGSA-GlideSysAttachment
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2020 07:43 AM
Hi,
db_image is a table name. And whenever an image is added to this table, record is not automatically created in sys_attachment table.
Regards,
Sindhuja.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2020 07:51 AM
It is, see the example image posted.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2020 03:50 PM
Hi Mark,
May be it would add a sys_attachment record if we add the image as attachment in db_image record. But not when we add it using Image field.
Below code worked for me.
var copyAtt = new GlideSysAttachment();
copyAtt.copy('db_image','1fdc9bc13762c850c11716a543990e1f','sc_request',current.request);
Regards,
Sindhuja.