- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on ‎06-14-2021 08:57 AM
Use case:
When we bulk import multiple software models into ServiceNow SAM Pro module, we might end up a case where we need to bulk respective software product logo/icon images too. But, through oob excel import we can't import the images. So, how do we do that?
Solution:
- First, load all the software models through your excel import (use normalized product names, publisher names)
- Store all your product images in a folder (IMPORTANT: Individual file name should be exactly similar as their normalized product name. Use the same as per your software model data.) For example: "Photoshop.png"
- Save this folder as zip file
- From the left navigation type "zip". Open Image ZIP upload.
- Upload your zip folder
- All your attachments will be now stored in db_image table
- Write a glide record to db_image table filter by created today, and created by your user id
- Inside the image GR loop, read the image file name through code
- Inside this GR, write a glide record to software model table filter by the product name
- Inside this GR, use GlideSysAttachment().copy() function to copy the image from db_image to cmdb_software_product_model
- Now the image is moved to softaware model table; but if you look at the software model record, you can notice that the image is stored as an attachment not linked to the "Picture" column.
- To move the image from general attachment to picture column, write another GR inside the software model GR for sys_attachment table, filter by table name is "ZZ_YYcmdb_software_product_model" and table sys id is your current sw model GR sys_id.
- Inside this attachment GR, set the "file_name" column value as "picture" and give gr.update();
- This is that tricky why we need to keep "picture" as file_name for everything. If you keep that value as static, then only the image will be linked to that particular column in sw model from. Otherwise it will just stay as general attachment at the top.
#SAM #SoftwareModel #SAMPro #Product #Image #logo #bulkimport
- 2,411 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi, thank you for this useful article!
However, it doesn't work with .svg files:
I'm getting this error for every single image.
Do you have a potential solution for this?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi, there is no such restriction mentioned by ServiceNow except for the ".bmp" file format per docs. The reason why you face this error could be because of your platform settings. Please check the system property glide.attachment.extensions to know the allowed file formats in your instance (refer this).
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Ready to make a splash in the crypto market? Bitmedia.io's Marketplace is the gateway to your success! Their comprehensive Crypto Marketing Services, encompassing targeted advertising and influencer partnerships, are tailored to meet your project's specific goals. Real-time performance tracking empowers you to make informed decisions and achieve the best outcomes. With their user-friendly platform and focus on security, Bitmedia.io ensures a seamless experience. Don't hesitate; visit today!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I just had the same issue / bug of using Image ZIP Upload for a collection of Font Awesome SVG files.
I can upload one individually, but the bulk upload rejects the svg file.
Time to log a support ticket.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi, thank you for this useful article!
When I zip file contain png images, it works perfectly and all images are uploaded from the zip file,
but if the file contains svg images, it gives an error and does not upload, unlike png images.
Do you have a solution for this?