HTML code being returned when previewing the document template of type HTML
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
HTML code being returned when previewing the document template of type HTML .I was testing the document generation through API script , but the pdf which got attached to the record shows with HTML tags . i have used some plain single line text to print . And even when i click on preview on HTML document template , it shows the same .Can you please let me know what am I missing.
var recordId = '52fc****;
var documentTemplateId = '252a***';
var pdfName = 'INC_Template.pdf';
new sn_doc.GenerateDocumentAPI().generateDocumentForTask(recordId, documentTemplateId, pdfName);
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago - last edited an hour ago
Hi @Veena-EeshB,
Have you added HTML code directly into the HTML canvas or via source code?
I have implemented a document creation and it works fine for template type as HTML template. I dont see any issues. I have created HTML code and built my document template. Your script is correct too.
Edit: assign the creation of template to a variable, not related to the issue but a good practice.
var result = new sn_doc.GenerateDocumentAPI().generateDocumentForTask(recordId, documentTemplateId, pdfName);
Regards,
Ehab Pilloor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
53m ago
share your content within that template
Regards,
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
