Skip to main content
June 5, 2023
Question

Line break Docx From Dynamic Template

  • June 5, 2023
  • 5 replies
  • 0 views

Hi,

I'm trying to insert a break line inside the xml that will build the docx from Dynamic template, I tried with <br>, char(10), but I don't know what to try anymore.

anyone have ideas?  

the error log: "Changed to The value of attribute "daybefore" associated with an element type "rowvalues" must not contain the '<' character." if I use <br>

5 replies

mikes0011
Brainy
June 5, 2023

"<br>" is HTML - to do manual trickery with Word files, you need to use the Word-flavored XML codes (not HTML), aka WordML.  I'm not exactly sure what syntax you'd need to use to do this within the Docx from Dynamic Template smart service, but the WordML carriage return is: <w:br/>

In the "word document from template" (older) smart service, it's possible to use the above by passing it in after a "text breakout" flag ("</w:t>") and then following it with another "text start" flag ("<w:t>").  Without doing these first it just tries to render as plaintext (though also the "<" and ">" characters cause issues if not sanitized first).  Again, it's all liable to be different in the "...Dynamic Template" smart service, so you'll need to experiment.

June 15, 2023

thx Mike, I resolved with "&#10;" as line break using advanced document templat

keerthik0010
April 7, 2026

Hi Cugino95,

How did you solve it?

Could you help with exact expression to solve this problem?

My issue is:

  • Text entered in a paragraph field on UI.
  • Generated DOCX from dynamic template shows the new lines entered in the paragraph field fine.
  • PDF from DOCX(generated docx) is not showing the new line but in same line.

Tried below snip:

substitute(
  ri!multiLineText,
  char(10),
  "</w:t><w:br/><w:t>"
)

Generated docs has this:

&lt;/w:t&gt;&lt;w:br/&gt;&lt;w:t&gt;Text Data &lt;/w:t&gt;&lt;w:br/&gt;&lt;w:t&gt;

Thanks

mathieud0001
June 6, 2023

Did you try the solution in this thread? community.appian.com/.../rendering-line-breaks-in-pdf