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
Jon
January 16, 2023, 3:39pm
2
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
BramKn
January 16, 2023, 4:08pm
4
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.
Jon
January 16, 2023, 4:10pm
5
The option there would be to change the query to select everything in one go so something like this…
2 Likes
system
Closed
January 23, 2023, 4:10pm
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.