I’ve tried a few things to get data into my hubspot GET here, but no matter how I structure the data one of the values is undefined.
If I send in the data using merge like this (simplified, but correct structure):
{
"vid": 125551,
"properties": {
"email": {
"value": "testing20@example.com"
}
}
},
{
"code": 1236
}
]
Then the “code” is undefined. If I swap the order and send like this:
{
"code": 1236
},
{
"vid": 125551,
"properties": {
"email": {
"value": "testing20@example.com"
}
}
}
]
Then “value” (which is the email) is undefined.
No idea why this is happening. I noticed this also happens when I try to use data from 1 node before and 2 nodes before. One is always undefined.
No idea what to try next. There must be something fundamentally wrong with how I’m using n8n
When I just input {{$json}} as an expression, it seems to show an object in [] that doesn’t contain the second part of that array. I’ve tried array notation like {{ $json[1].code }}, but that is undefined also.
Hi @jmr123 
Can you also fill out the following template:
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
Could you also share your workflow with us? Additionally, if you use the $("<node-name>") syntax in the expression editor, does this help you select the value?
I’m using n8n cloud with all the default settings and version 1.0.5. I’m on MacOS.
I think I have a fundamental question about n8n. Am I supposed to be able to get data from any previous node in later nodes? For example, can I get data using the $("<node-name>") syntax from, say, node 2 in node 7? Are there any limits to this?
I believe I sorted out the issue above though. After MANY attempts, I eventually came up with something like this {{ $('Merge').all()[0].json.properties.email.value }}. The .all()[0] was the key thing. I wasn’t aware of the all expression and that that’s where I could target a specific object in the array.
So the real trick here is this:
{{ $('checkIf').item.json.properties.email.value}}
where checkIf is a node not immediate connected to the one you’re editing. You need to use this format instead of
{{ $('checkIf').all()[0].json.properties.email.value }}
because if your previous node send in more than one item, this would use the data for the first item 3 times instead of the specific data for each item pulled from checkIf.
This was a massive amount of frustration for me, but figured it out and hope this saves someone’s day in the future.