-
Hi @jreyesr, Thanks for the clarifications/support so far on this amazing n8n-node. I have the below JSON coming from an SQL Query: [ Loading it (copy/paste) directly into the Context field works fine and I get 1 full report with all the elements. However, adding the SQL node as an input to the merge node and subsequently to the Carbone node, produces 6 inputs and the report get generated with 1 input at a time. The aim is to have all the fields available to the Carbone node and only 1 output produced Would be great if you can describe how to pass an array to the context field as well. Once the data is loaded, looking at the Carbone documentation, we can retrieve it on the template. Thanks again. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello! That seems similar to #10 (comment), give it a try and see if it works for you. In short: After the Postgres node and before the merge node, add an Aggregate node configured like this:
In the image below, you can see how the Aggregate node converts 100 items, each with an |
Beta Was this translation helpful? Give feedback.
-
Hi @jreyesr , Indeed. Similar query. The key here was to pass {{ JSON.stringify($json) }} to the context file. Otherwise it was just throwing an error. |
Beta Was this translation helpful? Give feedback.
Hello! That seems similar to #10 (comment), give it a try and see if it works for you.
In short: After the Postgres node and before the merge node, add an Aggregate node configured like this:
entries
field in the JSON will now contain an array of all the entries that were extracted from the Postgres DB{d.entries}
or{d.entries[i]}
and such to access each itemIn the image below, you can see how the Aggregate node converts 100 items, each with an
id
,title
andbody
, to 1 item with aposts
field, which is an array, where ea…