How to upload image icon for catalogs and category?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 12:06 AM
Hi,
I have written business rule to fetch data from third party application and create catalogs,category, and catalog item.I just want to know is there any way to upload the icon or desktop images for catalogs and category by same business rule.I don't want to do it manually.
Thanks,
Vimal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 03:08 AM
Hi Vimal,
I hope I can help you on this:
ServiceNow does not store any path values or so on the record itself.
Any fields of type "image" on a record is stored in the table "sys_attachment" where the field "table_sys_id" is the sys_id of your record, the field "table_name" is the name of the records table plus the prefix "ZZ_YY" (Example: "ZZ_YYsc_category") and the field "file_name" is the name of the image-field on your record.
It might be that, even though admin, while exploring the table "sys_attachment", you will not be able to see records where the field "table_name" is prefixed with "ZZ_YY". You need to add an ACL... at least that's what I was required to do.
Kind regards,
Michel Conter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 05:44 AM
Hi Michel,
Thanks for the reply!!
The way I understand is when user creates catalog and attach some icon or image manually , Attachments table stores image information.
So if we want to attach icon or image to catalog we need to do it manually we can do it from script.We can just access the information of image.
Please correct me if I am wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 05:54 AM
Correct, you need to store the image in the sys_attachment table.
You can have a look at the following link (one of my older posts). That code might contain some parts for your needs:
Import user photo from LDAP into S-N (reloaded)
GlideSysAttachment() might come in handy: ServiceNow Developers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2016 06:00 AM
Thanks!!!