n8nhackers / n8n-nodes-document-generator

This node renders Handlebars templates for documents or emails
MIT License
21 stars 4 forks source link

Question: read previous node data #3

Open hatifnatt opened 1 year ago

hatifnatt commented 1 year ago

Hello,

thanks for useful node, it looks easier than rendering template in Code node with JavaScript, but I have an issue.

Is it possible to read data from previous nodes? I'm trying something like

{{ node.[Schedule Trigger].json.[Readable date] }}

But it renders nothing.

mcolomer commented 5 months ago

Hi @hatifnatt,

Sorry about my delay. I was completely out one full year.

You can't read from previous nodes in template (basically, syntax of handlebars is incompatible with n8n syntax).

One way to bypass this limitation is creating a Set node where you assign values of previous executed nodes. After that, you can use the new variable in the Handlebars template following the next syntax {{newVariable}}.

Let me know if this works for you.