Hi,
I am currently receiving an error when trying to convert free text from a paragraph into an html, simply because the single apostrophe (') does not convert to a special character when trying to create html formats used to create a microsoft document and convert it to pdf. The document either shows the escape character of ' or we receive an exception error in the process model. I am using the smart service Configure DocX From Dynamic Template. I have been using the toHtml() function to convert all text into html format, but only receive this error for sing apostrophes. Any help would be useful. Thank you.
Discussion posts and replies are publicly visible
Hello Michael Lemenager
Not aware of a solution to make that work. Is it not okay to validate this text for the character while capturing the input in Paragraph field?
Why don't you use a regular expression for converting the apostrophe into a blank space for example?
I am generating a report, and the client deems apostrophe usage as a necessity.
And what if you scape the character¿? I mean, find the character and replace it with '
Anyway, check this link where you can find about a solution about this issue
community.appian.com/.../how-to-handle-special-character-in-xml-document
Scraping the apostrophe's removes the error, but you cannot control a client/user from using grammer with apostrophes. It messes up most user input from the client, and makes their input hard to read.
Is it not possible to sanitize user input text at generation time? I'm unfamiliar with the issue caused by apostrophes and toHtml(), however I have extensive experience doing manual workarounds to deal with other special characters (particularly ampersands and gt/lt signs) given their propensity to mess up Word Docx files when passed into the older Word from Template node.
Do you happen to have a sample starting / resulting text (and perhaps also "desired result text") that's causing you these issues? Otherwise I'm finding myself a little unclear on what exactly you're up against.
Yes, but I was not talking about eliminating them, but about escaping them in a way that is understandable by any interpreter, and does not cause errors in the execution.
Do you need to go the DOCX->PDF route? There is a great plugin that generates PDFs directly from HTML.
https://appian.rocks/2023/10/23/great-pdfs-with-appian/