Export fields and Variables on the form in pdf format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-16-2023 02:04 AM
Hi experts,
I have a requirement where I need to have a UI action to export the fields, related list as well as Variables present on the HR case form. With the OOB UI action, the variables are not exported to pdf.
An alternative is to use the PDFGenerationAPI, using which I can create a pdf having variables, but not sure how can I manage the export of the fields on HR case form in the same pdf as there would fields and related list that need to be exported too.
Does anyone have implemented anything similar to this?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-16-2023 02:25 AM
you can create UI action with this line in the onClick function. this does exactly the same what printer friendly version does
it will include fields, variables, related list
printList('25000');
UI Action will look like this
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
âš Certified Technical Architect || âš 9x ServiceNow MVP || âš ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â02-16-2023 02:38 AM
Hi Ankus,
Thanks for your reply.
I added it in UI action as you mentioned, but I would like to have this UI action on the Agent workspace, and it did not work. Do you see something wrong here?
Also, would it show variables in the pdf if they are made visible on condition. With Printer friendly version I observed, it does not show the variables which are visible conditionally(even when they are visible on the form).Looks like UI policy/ CS does not apply here while export.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â05-11-2025 08:31 PM
If someone is still searching for a solution, You can use the below script under workspace client script on UI action