"Download PDF" UI action in Workspace

swathi Gadde
Tera Contributor

Hello,

 

New to workspaces.Is there a way to create a UI action button on the form related list called "Export to PDF" so that when the user clicks the button it should export the related list records and user should be able to download. Is it possible to do in workspaces?

 

Thank you.

3 REPLIES 3

Abinaya Sekar
Tera Expert

Using a Workspace Custom Action / Widget (Recommended)

In ServiceNow Workspace, create a custom action button on a Related List Component.

Steps:

Go to Workspace Experience > Open the page containing your form/related list.

Add a Custom Action to the related list.

In the Action Script:

Query related records using GlideRecord.

Use a PDF library (e.g., GlidePDFDocument server-side or a client-side JS PDF library like jsPDF).

Return the PDF to the browser and trigger download.

Benefits:

Fully supported in Workspace.

Works regardless of the table or scope.

Provides better control over styling and content of the PDF.

Option C – Use Out-of-the-Box Reporting

You can create a Report on the related list table and enable “Export to PDF”.

Then, add a Report Widget or Related List Report Widget in Workspace.

This is the simplest solution and requires no coding.

 

Summary

Direct UI Actions on related lists may not always work in Workspace.

Best approach is to use Custom Workspace Actions or Widgets, or leverage Reports with PDF export.

Use GlidePDFDocument for server-side PDF generation if you need custom PDFs.

Ankur Bawiskar
Tera Patron
Tera Patron

@swathi Gadde 

there is no direct way for this

you can use PDF Generation API

check this link which has script from Piyush and enhance to include related list data

Generate PDF file for catalog variables and attach it to RITM 

you can check the PDF Generation API for this

Generating Custom PDFs - using the new PDFGenerationAPI

another method

Generate PDF and attach to the record

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Me Being Mustaq
Tera Guru

Hi @swathi Gadde ,

 

Please refer to the below link:-

 

If it is helpful, please hit the thumbs button and accept the correct solution by referring to this solution in the future it will be helpful to them.

 

Thanks & Regards,

Mohammed Mustaq Shaik