Copy link to clipboard
Copied
Finding some strange behavior which I can't explain. I am not super facile with node.js but assume when a variable is passed, it is accessible anywhere and repeatedly. Please correct me if I am wrong.
On a page of the docx, I am calling a variable which doesn't return anything...
# example
On a scale of 0-100, the document’s sentiment score is: {{ sentiment }}
However, if I repeat it elsewhere it renders...
# test area at the bottom of the doc
Test section
sentiment: 98 <-- this is the {{ sentiment }} variable repeated
# here is a snippet of the sampleData passed to the doc
const sampleData = {
<snip>
"sentiment": sentiment,
</snip>
};
# and here is a console.log of the correct sampleData
INFO sampleData--> { sentiment: 98}
I thought it was related to upgrading to @adobe/pdfservices-node-sdk 2.2.2 but I rolled back to 2.2.0 and the behavior still exists. In previous months, calling variables was rock solid and I got exactly what I expected.
Thanks in advance.
Copy link to clipboard
Copied
Are the fields within different contexts within the Word document like one is at the document level, one is in a table or conditional section etc? Can you share the Word file + the JSON?
Copy link to clipboard
Copied
That's the puzzling part; it's a simple variable taken from a dbase further upstream and passed in to a single field.
I will try to rip out the other code (I have ~10 variables used correctly), slim down and post.
Copy link to clipboard
Copied
Oddly, if I repeat the line, one right after the other, the first does not work but the second does. For now as a shim, I'm 'whiting out' the first line. Back soon.
Copy link to clipboard
Copied
Very odd. Are you sure the curly brackets are being opened and closed as pairs?