The CreatorCon Call for Content is officially open! Get started here.

How to view a PDF document or add a link of a PDF file to Service Portal

Ruwansiri
Tera Contributor

Hi Team

I have a requirement to view a PDF document via service portal. I am using service catalog record producer to enter data from the service portal. 

Would you pls help me to know, how to view/open a PDF document or add the link of that PDF file to the service portal. 

I am using Rome version

1 ACCEPTED SOLUTION

Hi,

you can use Rich text label variable and include link in it

Based on the Centre selected you can show/hide the variable using UI policy and then user can view the link and download the file

Regards
Ankur

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

View solution in original post

8 REPLIES 8

Hi Ankur

I was able to get the link of the PDF file to the service portal. But after clicking it, it is downloading. I want to open it on a separate window. I have added 'view=true' to the end of the URL. But no luck. Is there any possible ways to do it ?

Hi,

I hope Document viewer plugin is activated in your instance.

If yes then you can view it like this

-> give sysId of the sys_attachment record here and open this URL in new tab

/$viewer.do?sysparm_stack=no& sysparm_sys_id=c559fac007c011102011ff208c1ed050

OR

Another method is to use widget and show the pdf content inside it; show/hide the variable based on your UI policy

how to render pdf content inside widget; check this solution I shared 1 year ago

Attach a default pdf to service catalog item

Regards
Ankur

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

Hi Ankur

this is the URL i am using

https://advancedserviceprovidersaaspdemo10.service-now.com/nav_to.do?uri=sys_attachment.do?sys_id=259a0f801b4851102d339936b04bcb4f&view=true

AND this is the URL, that I have changed according to your given format

https://advancedserviceprovidersaaspdemo10.service-now.com/nav_to.do?uri=sys_attachment.do?$viewer.do?sysparm_stack=no& sysparm_sys_id=259a0f801b4851102d339936b04bcb4f&view=true

But is displays empty page and Attachment not found

Can you pls help to advise ?

@Ruwansiri 

I hope I have answered your original question.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

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