- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â10-25-2023 09:23 PM
Hi All,
Currently, A PDF is generated from a workflow with all the variable values once a request is submitted. I'm using the PDFGenerationAPI() for this and below is the code I'm using in the workflow Run script which is working as expected.
var fileName = 'REQ_' + current.number;
var pageProperties = {
HeaderImageAttachmentId:'',
HeaderImageAlignment: 'LEFT',
PageSize: 'A4',
GeneratePageNumber: 'true',
TopOrBottomMargin: '72',
LeftOrRightMargin: '36'
};
var html = '<html>' +
'<head>' +
'<title></title>' +
'</head>' +
'<body>' +
'<h2>My Request</h2>' +
'<ul>' +
'<li>Open on behalf of this user: '+ current.variables.open_on_behalf_of_this_user.getDisplayValue() + '</li>' +
'<li>Please identify what you require: ' + current.variables.please_identify + '</li>' +
'</ul>' +
'<p>Authorised approver:<br />' +
current.variables.authorised_approver + '</p>' +
'<p> </p>' +
'</body>' +
'</html>';
var pdf = new sn_pdfgeneratorutils.PDFGenerationAPI().convertToPDFWithHeaderFooter(html, 'sc_req_item', current.sys_id, fileName, pageProperties, '');
result = JSON.stringify(pdf);
This is working as expected and a PDF is generated once a request is submitted. But the requirement is to generated a word document in the same way.
Can anyone suggest a way of doing this.
Any help would be highly appreciated.
Regards,
Nagashree.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â10-25-2023 09:39 PM
no direct way for this.
you would require custom solution for doc and mid server for docx
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
â10-25-2023 09:39 PM
no direct way for this.
you would require custom solution for doc and mid server for docx
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
â10-25-2023 10:01 PM
@Ankur Bawiskar, Thanks for the response.
what is the custom solution for this to work, Can you pls suggest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â10-25-2023 10:12 PM
Nothing in my mind as of now as I haven't had any such requirement from any customer.
Since this is not available OOB, I would suggest you to inform your customer about the limitation of platform.
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