Upload a file and create a shareable link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 12:36 PM
Hello all,
Is there a way to upload a file to ServiceNow and then create a shareable link to it? The file would not be attached to any record, just a record in of itself.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 02:06 PM
Hi, I think you would need to find a way to upload the attachment directly to sys_attachment table, and potentially you could create a record producer to do this. But I have not tested the impact of setting table_sys_id to be the sys_id of the same sys_attachment record (eg itself).
The url would simple be the URL of the attachment record, which would download the attachment if you navigated to it, or you may be able to leverage document viewer to open the attachment in your browser;
Document Viewer (servicenow.com)
You can create the url via script, as long as you have the sys_attachment records sys_id eg
var myURL = 'https://' + gs.getProperty('instance_name') + '.service-now.com/sys_attachment.do?sys_id=' + current.sys_id;