The CreatorCon Call for Content is officially open! Get started here.

How to insert multiple images in catalog item.

SWAPNAG67418591
Mega Contributor
i need to insert 3 pics in a variable of a catalog item in ServiceNow , based on the requirement user needs to be select the picture.
 
can anyone tell me the step by step process for achieving this?
3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@SWAPNAG67418591 

1 attachment variable supports only 1 file

You will require 3 attachment variables for each of those pics.

OR

Let users use OOTB paperclip icon to add files and then use onSubmit client script to validate number of files attached.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Anand2799
Tera Guru

Hi @SWAPNAG67418591 ,

 

As Ankur suggested either create different variables for images or use the OOB attachment feature to get the images.

Please note attachment type variables does not add files to requested item form/attachment list, it will only be visible on variable section.

 

Thanks

Anand

M Iftikhar
Giga Sage

@SWAPNAG67418591 

If I’ve understood the requirement correctly, you already have the images, and the user just needs to select one while filling out the form. In that case, I’d suggest keeping it simple — you can include the images in the catalog item description with unique tags, then add a select box for the user to choose the corresponding tag. You could also have a hidden attachment-type variable to store the selected image, and on form submission, copy the relevant image to that variable based on the selected tag.

Alternatively, if you want a more interactive experience, you could create a custom widget or UI Macro to display and handle image selection directly on the form.

Tried 1st approach on PDI:

MIftikhar_0-1759832839484.png

 

Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.