Make a link to an attachment

dfry123
Mega Expert

Hello All!

I'm trying to make a link on a record producer that would open an attachment in the sys_attachments table. I got this working but it opens a completely new tab to service now. Is there a way to just have it open in the same window?

Thanks!!

1 ACCEPTED SOLUTION

dfry123
Mega Expert

I ended up adding the attachment to KB and then referencing the sys ID. Thanks for the help!


View solution in original post

4 REPLIES 4

Abhinay Erra
Giga Sage

Add "nav_to.do?uri=" after your base instance url like this



Here is an example


https://<baseURL>/nav_to.do?uri=<table name>.do?sys_id=-1


Chris M3
Tera Guru

Can you post what you did?



This may just be a browser behavior, and not related to service-now or your code.   It might depend on the type of attachment also.


So my code is below using what Abhinary gave me. When I do this it refreshes the page and then has the download prompt.




<a href="https://myinstancekdev.service-now.com/nav_to.do?uri=sys_attachment.do?sys_id=a62d8d580fd4ba00c9fa59..." >Example Report</a>


dfry123
Mega Expert

I ended up adding the attachment to KB and then referencing the sys ID. Thanks for the help!