KB Knowledge Article: Export an article to Word format (.docx)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2019 02:52 AM
Hello everyone,
I have a requirement that might be tricky:
Our customer is using the "Import Article" functionality to import and create a new KB article.
He wants one requirement :
In the KB article form, he wants:
- One button (UI action) called "Export to Word format (.docx)"
- This button will export the content of "Article body" HTML field to .docx format
- The Word (.docx) document downloaded has to be formating like HTML field and also if pictures are visible in the KB Article (so in "Article body" HTML field) they are to be visible in Word document exported
Did anyone already do this functionality or something close ?
Regards,
Yassine
- 8,353 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2019 08:08 AM
Hello Yass,
You can try this modified version of a script that I found off of this question
I am sure you can get this working with a .docx
function createDoc() {
var sysparm_table = g_form.getTableName();
var sysparm_sys_id = g_form.getUniqueValue().toString();
var url = sysparm_table + '.do?DOCX&sys_id=' + sysparm_sys_id;
window.open(url);
}
Let me know if you run into issues with this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 03:49 AM
Hi Cody,
I've a same requirement, above code in not working for me. I have created a UI Action with the following script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2020 04:16 PM
What is the business use case to export an article into Word?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2020 06:39 AM
Hello Yassine and Raj,
We created something similar for one customer. Its included in the app described in the following article: https://community.servicenow.com/community?id=community_article&sys_id=35679790db1bcc90414eeeb5ca961...
- One button (UI action) called "Export to Word format (.docx)" - We have the "Generate file" button.
- This button will export the content of "Article body" HTML field to .docx format - You can configure the template to export also some other fields from the KA, alongside the "Article Body".
- The Word (.docx) document downloaded has to be formating like HTML field and also if pictures are visible in the KB Article (so in "Article body" HTML field) they are to be visible in Word document exported - The idea is that the KA is replicated in a Word file.
Kind regards,
MRC
Could you please share the details about how could export form to Word.
Thanks,
Raj