Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
7 replies
Subscribers
5 subscribers
Views
2515 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Reports
78890 - no subject - My process modulear as below:\n"User Inp
dhavals
over 10 years ago
My process modulear as below:
"User InputTask" >> "Office Document Generator" >> END
here, In document generator, have used DOCX template file and mapping of parameters used in document template and process variables.
PROBLEM: when user input value contains ampersand (&) then generated docx file shows error while opening it But when we enter '&s;' instead of '&' then it works fine. Now, i have many reports containing lots of text file. Is there any shortest way to tackle ampersand population into report (i don't want to create function and pass each process variable through that function).
thanks...
OriginalPostID-78890
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 10 years ago
This is documented at
forum.appian.com/.../Word_Doc_from_Template_Smart_Service
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
{quote} "Substitution values cannot contain HTML formatting tags, such as <i> or <b>, or the characters &, <, and >. If necessary, use the toHtml() function to remove these characters." {quote}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
This is because at the end a DOCX is defined through an XML and those characters need to be escaped.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
dhavals
over 10 years ago
thanks for your comments.
Do you mean to pass each process variables from toHTML() function and which will convert '&' to '&s;' ? by converting toHTML() , does it impact for docx file generation as i am generating document file and not the HTML one.. ?
if yes then, can you please share me some shortest way to apply this for each process variables. i do have 100+ around process variables for most of the reports. it would be great if i can apply at some single place and apply to all varaibles.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
Yes, this same function applies when building a DOCX as described in the documentation.
When configuring this node in the setup tab in the "Replace with" column wrap your expression within tohtml()
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mike Schmitt
Certified Lead Developer
over 10 years ago
for what it's worth, there's an error in the documentation on the behavior of toHtml, which i noticed when i checked it out just now. The example text says: "toHTML("Hello <br> World") returns Hello &lt;br&gt; World" (
screencast.com/.../KasQosU4GZ5)
, which is wrong. It actually returns "Hello <br> World". The 'replacement' has been done one too many times in the documentation.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mike Schmitt
Certified Lead Developer
over 10 years ago
Also, to the original asker: for my project I wrote an expression rule which replaces the <, >, and & characters as described here, but which also replaces the carriage-return character (in case of paragraph inputs) with the appropriate wordML carriage return tag ("<w:br/>"). This way I can control what is (and isn't) replaced when I call the rule, and i basically pass all text through this rule in the Doc Generation node if there's any chance that these special characters will be in the text.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel