I’m really enjoying working with n8n, but may have found an issue in the XML to JSON node. I’m sure I’m doing something dumb, since most of my other workflows were easy, one and done’s.
Basically, I’m receiving webhook events just fine, but the downline XML node can’t seem to access the XML input property. Most interestingly there are two different JS error codes for the same error. I’ve attached the workflow and error(s) screenshot in the XML node to the bottom.
Note that the XML message seems correctly JSON unescaped:
But the output red error text suggests (to me) that XML is trying to use the .message payload as a property not data.
Item has no JSON property called “<?xml version="1.0" encoding="UTF-8"?>GV23989n001_huegrp90.3989Y”
Adding mystery, the popup message shows something different, also not a property.
Problem in node ‘XML’ Item has no JSON property called "GV23989n001_huegrp90.3989Y
I can’t tell if there are multiple JS issues firing, or something else. “no JSON property called "GV23989n001_huegrp90.3989Y” has internal XML parser error smells, but I’ve validated the source XML in other tools with no issues.
Thank you in advance for your expert advice.
Environment:
Node type: n8n-nodes-base.xml
Node version: 1 (Latest)
n8n: version: 2.1.5 (Self Hosted), default DB, docker, Linux arm64
Hi @ferventgeek, The field (Property Name) states you need to give the name of the variable which holds the xml, so in this case instead of using an expression, you should just have the value: “message”. Add a set node before the xml and map out the body.message to a variable called “message”
Ahhh.. ok, I think what’s happening is the editor can navigate input json with no issue because it’s only looking at the current input. But the “real” output (worflow execution) can’t .dot navigate down into the payload message. Set, adds a named “pointer” into the actual path, making it persistent and accessable across the execution path.
What I’ll have to test if non-flat object navigation limits apply to all nodes, or just the XML node.
That is correct, we essentially make a copy of the value of body.message into message. This way it is easier to reference the name of the variable directly. But the key here was that you only had to give the name and not the value