Advanced Document Template smart service error

I am trying to use the Docx From Dynamic Template smart service  (PFA document sample) with a single test field on the document I am getting the error as mentioned below: 

Testing.docx

 

freemarker.core.NonStringException:
For "${...}" content:
Expected a string or something automatically convertible to string (number, date or boolean),
but this evaluated to a sequence+hash (wrapper: f.e.dom.NodeListModel):==> doc.project.StatusName
[in template "fr.opensagres.xdocreport.document.docx.DocxReport@4cb802c!word/document.xml" at line 4, column 5921]The failing instruction:==>
${doc.project.StatusName} auto-escaped [in template "fr.opensagres.xdocreport.document.docx.DocxReport@4cb802c!word/document.xml" at line 4, column 5919]

 

Can anyone help me with the same, please?

 

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents
  • Hi,
    It would be better if you go step by step using this smart service. Firstly when you create a XML, make sure the XML is in proper format(You can just put XML in a private variable to store its value and check online using any XML checker). When you have validated your XML now when you are using the smart service make sure in the template the field you have matches the name of field present in XML. In your template its showing "${doc.project.statusName}" but whne you select this in word and click on edit field it shows "${doc.project.StatusName}". So make sure your mapping is correct there.
    If you follow these steps accordingly you will not face any issues. Make sure XML format is correct as no data in XML can contain some special characters like (< , > &). If you still face any issue please let me know.
Reply
  • Hi,
    It would be better if you go step by step using this smart service. Firstly when you create a XML, make sure the XML is in proper format(You can just put XML in a private variable to store its value and check online using any XML checker). When you have validated your XML now when you are using the smart service make sure in the template the field you have matches the name of field present in XML. In your template its showing "${doc.project.statusName}" but whne you select this in word and click on edit field it shows "${doc.project.StatusName}". So make sure your mapping is correct there.
    If you follow these steps accordingly you will not face any issues. Make sure XML format is correct as no data in XML can contain some special characters like (< , > &). If you still face any issue please let me know.
Children
No Data