How To Create Links which Open Documents in Document ViewerSummaryThe Document Viewer feature was added in the Madrid release. It allows users to open PDF documents (with support for other formats to be added later) directly in a 'Document Viewer' browser tab or window, instead of having to download them with the browser's download manager and then open them from the file system. By default users can only open documents in Document Viewer by clicking the [View] link next to the attachment name on a record (for example Incident). Some customers requested a way to open documents in Document Viewer from other parts of the UI, such as the Service Portal.ReleaseMadrid and newerInstructionsTo get a link that will open in Document Viewer you need to get a direct link to the sys_attachment record and add the URL parameter view=true. For example: Find an Incident that has a PDF document attached. Get the sys_id of the Incident you have open (<hamburger menu>->Copy Sys_id)In the Navigator type sys_attachment.list and hit enter, to open the Attachments table directlyOn the Attachments list filter by Table Sys ID Is <sys_id>You can now right-click the record it found and Copy URL, it should be something like: https://<instance-name>.service-now.com/nav_to.do?uri=sys_attachment.do?sys_id=fa615af2db573b001c1d468b3a9619fc You can then modify the URL to be https://<instance-name>.service-now.com/nav_to.do?uri=sys_attachment.do?sys_id=fa615af2db573b001c1d468b3a9619fc&view=true Of course, you can also build these URLs programmatically by using a GlideRecord object to search the sys_attachment table to get the sys_id and then building the above URL in your code. This may be more useful where you want links to PDFs generated automatically in a Service Portal. NOTE: This will not work for files attached to a field of type attachment_field (where the form has been customized with a field of type attachment_field).Related LinksThis has been tested on Madrid. There is no definite guarantee that it will work in future releases of ServiceNow