Attachment link in a field on a catalog item

gnunez
Kilo Guru

Hello,

I know documents can be attached using the paperclip in the top right corner of requests, but I want to see if there is a way to also have that show for a field. I have found discussions on form annotations and they seem to be in the right direction but not quite what I am looking for.

The result I got from this post https://community.servicenow.com/thread/163456?q=Attachment%20link%20paperclip , gives me the following on the form:

find_real_file.png

1. the link is not clickable

2. I want to have that but under a field (e.g. Name: Click here to manage attachments or something around that nature) I just want to be able to add it to a different section of the form that is not the top.

Anyone else have the same issue or can offer an tips?

Thanks in advance,

Grace

1 ACCEPTED SOLUTION

sreejith12
Tera Expert

Hello Grace,



May I know which version of ServiceNow are you using? Jelly doesn't work on versions after the Geneva and even I had same issues as Macros doesn't work.


The Out of Box feature of attachment paperclip in a catalog Item is part of Service Catalog widget which you have to use in versions after Geneva.



You can create a new widget with below HTML code which can give you a paperclip below your field but you'll need to figure out the client and server scripts that will actually upload the file to the form.



<div id="sc_attach" >


<label tabindex="0" style="float:left;font-weight:normal;cursor:pointer;">


<sp-attachment-button></sp-attachment-button>${Add attachments}


</label>


</div>



You can try adding this widget to the variable in the default value section.



Thanks,


Sreejith


View solution in original post

3 REPLIES 3

sreejith12
Tera Expert

Hello Grace,



May I know which version of ServiceNow are you using? Jelly doesn't work on versions after the Geneva and even I had same issues as Macros doesn't work.


The Out of Box feature of attachment paperclip in a catalog Item is part of Service Catalog widget which you have to use in versions after Geneva.



You can create a new widget with below HTML code which can give you a paperclip below your field but you'll need to figure out the client and server scripts that will actually upload the file to the form.



<div id="sc_attach" >


<label tabindex="0" style="float:left;font-weight:normal;cursor:pointer;">


<sp-attachment-button></sp-attachment-button>${Add attachments}


</label>


</div>



You can try adding this widget to the variable in the default value section.



Thanks,


Sreejith


Hi Sreejith,



We are on Istanbul UI16. No wonder!! Nice to know thank you!



Thanks for the tip! Is there a certain variable type I should be using in the catalog item? Currently its just a textfield so the HTML code shows as the default, unless it should be that way?



Thanks,


Grace


Hi Grace,



I used a macro variable in the catalog item and instead of attaching a macro ,you can attach the widget from the default value section .


Thanks,


Sreejith