Export to PDF Strategic Planning Workspace

Farfara
Tera Contributor

Hello everyone @Namita Mishra @Sandeep V1 

I have a requirement to add a UI Action on the Strategic Planning Workspace like " Export to PDF".

 Can you help me to achieve this please.

Farfara_0-1679924961636.png

 

Best regards,

 

FF

6 REPLIES 6

J-Paul Millet
Mega Guru

Good question @Farfara  ! I have the same. So, I'm interested by any answer/guidance 😉

Best regards, Jean-Paul

Rajesh_Singh
Kilo Sage
Kilo Sage

@Farfara we did this for one of our client 

 

  1. Create a new button component:

    • Go to "Now Experience" > "UI Components" in ServiceNow.
    • Click "New" to make a new component.
    • Give your component a name, like "ExportToPDFButton."
    • In the HTML section, make a button and style it as you want.
  2. Add a script for the "Export to PDF" function:

    • In the client script section of your button component, write JavaScript code for converting the content you want to a PDF format. You can use a library like jsPDF for this.
    • Attach a click event listener to the button you made in step 1, so the PDF export function will run when the button is clicked.
  3. Put the button component in the Strategic Planning Workspace:

    • Go to "Now Experience" > "UI Builder" in ServiceNow.
    • Open the Strategic Planning Workspace in the UI Builder by searching for it.
    • Find where you want to put your "Export to PDF" button in the workspace.
    • Click on the "Components" tab, find your button component (ExportToPDFButton), and drag it to the right place in the workspace.
    • Save and publish your changes.
If you found my response helpful or applicable, please consider marking it as correct or helpful to assist others who may be seeking the same information.

---------------
Regards,
Rajesh Singh

You can use a library like jsPDF (https://github.com/MrRio/jsPDF) or another suitable solution to convert the desired content to PDF format.

If you found my response helpful or applicable, please consider marking it as correct or helpful to assist others who may be seeking the same information.

---------------
Regards,
Rajesh Singh

I am also interested in the JavaScript code since my Senior Leadership team is interested in this functionality for roadmaps in SPW. Can you provide that to me? Thank you.