Best method of adding a link to an attachment on a catalog item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2020 10:20 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2020 10:27 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2020 07:18 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader