Add answer from Postgres to item without rewrite item

Hi, can anyone tell me how to add result of Postgres node to my JSON
I have array of items, like:
{"id:“1”,
“time”:“10:30”,
“answer”:“yes”}

then i need to find name by id from Postgres node and add answer to that item
result:
{"id:“1”,
“name”:“Sara”,
“time”:“10:30”,
“answer”:“yes”}

Information on your n8n setup

  • **n8n version:**0.181.2
  • **Database you’re using (default: SQLite):**Postgres

Hey @Sergey_Galay,

A real quick solution could be to use a merge node and match on the id so something like this…

thx, but if i have 1000 start items, it will be 1000 similar executions of Postgres node :frowning:

the sql node can be set to run only once. and most often the sql nodes already only run only once by default.
simply need to make sure the first query returns everything you need.

The option there would be to change the query to select everything in one go so something like this…

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.