I have a work flow that take data from a form via webhook, then runs 3 processes and sends the combined data via email. The issue is that, despite the data fields showing as populated on the input, it return an empty expression error.
I have done some more testing, and it appears to work fine if only one of the branches are run. All 3 work independently, but if there is data for 2 or all 3, then the email is not being passed.
Hi @ethicallymad, thanks for reporting this and for testing out various scenarios. Could you maybe share us your workflow (or parts of it) here? You can do that by copy & pasting the workflow JSON content in between two block quotes (```). That would make it easier for us to try and reproduce this issue on our end.
I have made a couple of changes to try clean up the expressions, and pass the project name and email to the end of the flow (via a switch and a merge), but still the same problem. Here is the current updated flow
As you can see, only one field is being picked up (imageresults), the others are showing as empty, even though the input clearly shows they exist and have data.
I see on the first screen that you have a Code node between Merge and Outlook. But on the last screen you are showing the output of the Merge node.
$json property can refer only to the items of the previous node.
As you have Merge node in Append mode, you can’t refer to the previous nodes with $(<nodename>).item.json property, you can only refer via $(<nodename>).last().json, $(<nodename>).first().json or $(<nodename>).all() methods
Thanks @barn4k for the input, but unfortunately I don’t think that is the entire issue. I have tested the fields from multiple nodes, and that may not have been the best screenshot to share.
As you can see below, one field from the previous node worked fine (that was also a merge), others did not. And one from a defined earlier node is also not working:
Hey @barn4k - the work flow screen shot and json code are both as above. not changed anything here (other than to experiment with trying to take the email from different nodes in the flow). The email always shows as present on the left (input), and I am dragging and dropping the expression onto the node. None of this is being hand coded, which is why I would think it was hard to get wrong (other than if the variables change editing the flow, which could break things, but this is always the last thing I am trying to resolve). Cheers
Your Merge node works in Append mode and as you have 5 inputs, you will receive 5 items in the output. You should use the Combine Mode (by position) instead.