Skip to content

Loading data into a template #13

Closed Answered by jreyesr
JV300381 asked this question in Q&A
Discussion options

You must be logged in to vote

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:

  • Set the Aggregate dropdown to All item data (into a single list)
  • Set the Put Output in Field field to entries or something similar
  • The entries field in the JSON will now contain an array of all the entries that were extracted from the Postgres DB
  • In the template, you can now do {d.entries} or {d.entries[i]} and such to access each item

In the image below, you can see how the Aggregate node converts 100 items, each with an id, title and body, to 1 item with a posts field, which is an array, where ea…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by JV300381
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants