how to allow multiple attachments using attachment type varaible in service portal

kalyani23
Tera Contributor

Hi, 

can someone provide solution on how to attach multiple files for each attachment type variable in record producer form for the service portal.

Regards,

Kalyani.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

not possible.

it can hold only 1 file at a time

If you want multiple files then you can use OOB paper clip icon or create those many attachment variables

Regards
Ankur

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

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

not possible.

it can hold only 1 file at a time

If you want multiple files then you can use OOB paper clip icon or create those many attachment variables

Regards
Ankur

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

phil_bool_unifi
Tera Guru

It might be more accurate to say that the 'attachment' variable isn't designed to be used in that way - it only accepts one attachment.  One approach you might want to consider is to have a 'select' variable called 'number of attachments' that accepts a numerical value between zero and a maximum number, like 5.  You then create 5 'attachment' variables on the item/record producer, and use 5 UI policies to show/hide each variable... so there's a UI policy that detects if the variable is one or greater, and shows attachment variable number 1.   A second UI policy checks if the value is 2 or greater, and if so, displays the second attachment variable.  Repeat up to the maximum.  

 

Obviously, it may be possible to create a custom version of this widget that would allow any number of attachments, but the OOTB 'attachments' functionality on the form as a whole already does this, and these variables have a range of other, powerful benefits like the ability to validate file type that you don't get, so this is the approach I'd recommend.