Best method of adding a link to an attachment on a catalog item.

Ear19
Giga Expert

I have a requirement to add a link on a catalog item to an attachment.  Would like to store the attachment within ServiceNow and wanted to know the best method.  Is it as simple as placing the document on the sys_attachment or the sys_attachment_doc table and just providing a link to it?

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Can you explain you want to add link on catalog item to an attachment?

you can use UI macro variable to show the link of attachment; if you want users to click that link and download the file then the link should include sys_attachment table in the url

sys_attachment_doc stores the metadata about attachment

sample UI macro script below

Give the sys_attachment record sys_id in the url in place of sysID

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

	<div>
		<p>
			<span style="font-size:20px">If you need access, please click
				<a href="/sys_attachment.do?sys_id=sysID" rel="nofollow">Click here</a>
			</span>
		</p>

	</div>

</j:jelly>

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Ankur Bawiskar
Tera Patron
Tera Patron

if my answer helped you, kindly mark it as Correct & 👍Helpful so that it does not appear in unanswered list & close the thread.

Regards
Ankur

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