"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.

1 ACCEPTED SOLUTION

OmkarR485928563
Mega Sage

@swathi Gadde ,

 

It is possible with a custom UI action.

Create a Related List Declarative Action as shown in the screenshot. Enter your table name if you want this to be visible only on a specific related list table or set it to "Global" and add a condition for which table you want this to be visible on.

In the "Specify client script" field, use the OOB Action Payload Definition (Export) shown in the screenshot.

That's it.

 

A few things to remember:

  • Since the action is on the Global table, this UI action will be visible on every related list. You will need to add a visibility condition to the UI action if you don't want to visible on all related list.
  • Check if it follows the related list filter condition. We have implemented this in the Zurich version of ServiceNow. I'm not sure about previous versions.

For information only: The "Export" payload definition is used in the OOB "Export" button on the list view. We copied the same configuration to the related list button. You don't need to implement any API or script. I have added the screenshot for reference, copy the same. 

 

Action Payload Definition (search, don't create/update)

Action Payload Defination.png

 

Related List Declarative Action

Related List Declarative Action.png

 

Regards

----

If this response was helpful, please select "Accept as Solution" and "Helpful." This helps both the community and me.

View solution in original post

6 REPLIES 6

Hi!

I am using this action payload setup on a ui action button since Xanadu and just recently upgraded to Zurich but now the export delivers the entire related list. Do you have any insight on how to ensure that the filter conditions are provided in the export? 

@OmkarR485928563 -

 

Thank you it worked as expected.