Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need to generate Word Document

Avinash44
Tera Contributor

Hi All,

 

I am looking for an option/suggestion that, whether in ServiceNow, is it possible to generate Word document. I have a requirement that, Client has shared some pre-defined templates and in that, we need to map certain values from the record (Case table).
So by surfing in the internet, I found that, in Document Templates, we can able to achieve it by installing some plugins. I tried installing those and tried creating sample document templates, but still I am not sure what configuration am I missing, as the values are not mapping.

 

So if anyone worked on this and have some insights on this, please provide me the explanation and steps also if that needs to be followed, so that it will be really helpful.

 

Below are the things I tried from my end:

 

1. Created one sample word document (.docx) and inside that I have added some random paragraph along with field which needs to be mapped with Case table.

 

Content present in the word doc ,for example:

The Number is ${number}.


Also, I tried with multiple combinations. For eg: ${number} / {{number}} / number / {number}. But still no luck.

 

2. Created new document template in servicenow by selecting Word Template and attached the above word doc in the document field.

 

3. Tried clicking the "Parse word document" related link, but it doesn't create any. So I tried with manual mapping and here I can see couple of fields "Document Field", "Field Name" and in these fields, I provided values with multiple combinations as per above (number, {{number}}, ${number}...) and in Mapping field, I selected Number. 

 

4. Once I added the mapping manually, I can see Preview Button appeared in the Document Template, I selected respective Case record and clicked on "Generate Preview", it generates a word document and attached in the same document template and when I check the preview doc, I dont see anything got mapped. 

Whatever I entered in the word document, I can still see the same.

 

I know its very big message but just wanted to let you all know, what i tried. So if anyone could provide insights on this, it will be really helpful.

 

1 ACCEPTED SOLUTION

@Avinash44 

Once the document template is published whatever documents (PDF) will be generated will be based on those field mappings.

if they move that template to Draft and edit and change the mappings System cannot automatically generate new documents (PDF) with the new mappings and attach to the earlier records.

It has to be done manually or via a custom solution.

I believe I have answered your original question and subsequent question as well.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

10 REPLIES 10

M_48
Tera Contributor

the plugin you mentioned doesn't exists
The field you mentioned for the document templates also doesn't exists