Export to PDF Strategic Planning Workspace
This content was last updated in 2023. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 06:51 AM
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.
Best regards,
FF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 08:25 AM
Good question @Farfara ! I have the same. So, I'm interested by any answer/guidance 😉
Best regards, Jean-Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 09:14 PM
@Farfara we did this for one of our client
-
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.
-
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.
-
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 09:15 PM
You can use a library like jsPDF (https://github.com/MrRio/jsPDF) or another suitable solution to convert the desired content to PDF format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 11:35 AM
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.