Attachment link on a variable on catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 04:06 AM
Hi All,
I have a requirement to have an attachment link attached to a variable from which an attachment could be downloaded.
For example:
Please click here to download.
When click here is selected it should download an attachment for the user.
How to achieve the same.
Looking forward for ideas/ suggestion / solution.
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 04:42 AM
Hi @DPrasna ,
You can create catalog variable with Type as "Custom", then create and attach new widget to this variable, like below:
-> Create new Widget
->Map newly created widget to variable
-> Output:
If my response was helpful in resolving the issue, please consider accepting it as a solution by clicking on the ✅Accept solution button and giving it a thumbs up 👍. This will benefit others who may have a similar question in the future.
Thank you!
Ratnakar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 04:51 AM
Use an HTML variable on your Catalog Item/Record Producer.
If the link is a static one you can directly set it on the variable itself otherwise if the link is dynamic then make a GlideAjax call inside your OnLoad client script, get the value from backend and set the value of HTML field
g_form.serValue('html_description', '<a href="https://www.w3schools.com">Visit W3Schools.com!</a>
>');
Also, in your onLoad client script make sure to set the html variable as readOnly. This will make the variable non editable and the user can only interact with the link and will not be able to change contents of it.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 04:56 AM
you can add that file to catalog item
then you can use Rich text label variable and include link to sys_attachment so that user sees the link.
It will work in both native + portal
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 11:37 PM
Hi Ankur, could you please let me know how to add the link to the rich text label?