I’m not sure why this isn’t working and also not sure how to use the UI to diagnose it better.
The IF statement -should- catch whether the field key for that pipeline is present in the “fields” array, and only call the next step if it’s not present. But it’s registering false even when I can see the key present in the output.
Questions:
1)What am I missing?
2)How can I use the UI tool to diagnose this better? That is, how can I see what the expression evaluates to for the 10th, 100th, 1000th item in the input?
3)If I’m looking at the 1000th item in the input, how do I see the values of nodes immediately prior that are linked to that input? Specifically, how can I check which field key it’s testing?
Please share the workflow
Share the output returned by the last node
Information on your n8n setup
**n8n version: 0.216.0
**Database you’re using (default: SQLite): MYSQL
**Running n8n with the execution process [own(default), main]: own
**Running n8n via [Docker, npm, n8n.cloud, desktop app]: on single EC2 instance
Hi @Lee_S, I am sorry to hear you’re having trouble. It’s not clear to me what you’re doing here as I don’t know which data structures each of your nodes would return.
Does the number of items between your HTTP Request and the MySQL node change for example? If so, your expression {{ $json["fields"].hasOwnProperty($node["MySQL"].json["field_key"]) }} might not resolve as one would expect.
2)How can I use the UI tool to diagnose this better? That is, how can I see what the expression evaluates to for the 10th, 100th, 1000th item in the input?
I’d simply use add a Set node before your IF node and use the expression in the Set node. You can then easily see what your expression returns for every single item.
3)If I’m looking at the 1000th item in the input, how do I see the values of nodes immediately prior that are linked to that input? Specifically, how can I check which field key it’s testing?
You can simply hover over the item you’d like to show a preview for. The preview will show up just below your expression. It’ll change for each item you hover over:
I’ll have to go look more carefully, but the number of items “expands” down the chain. That is: every row from the MySQL results generates an HTTP request, and each HTTP request has 1+ results. (I guess some could have zero results but I can filter those out.) So each there should be a many to one relationship between HTTP results and the MySQL rows further up the chain.
Inserting a couple of “SET” modules for debugging is a great idea. I’ll do that. I do find myself using “Code” modules a lot to surface items from prior nodes so they can be processed. SET is probably a simpler way to do the same thing.
re my question about looking at how different inputs are being used: I discovered the “hover” feature afterI posted. Thanks for that. Does that only work on the immediately prior input? If I go further up the chain, can I hover over a SQL row (in this example) and see how it’s rendered by the module?
Thanks so much for the detailed help. It really makes a big difference to my adoption of n8n that people are willing to dig into helping navigate learning and using n8n in everyday, real world situations.