How to send an array as individual rows to Postgres/any DB like Baserow etc

Describe the problem/error/question

I have a node that outputs the dimensional values for pieces of text. The result is an array of different values as mentioned in the sample workflow below. I would like to send the values as individual rows to Postgres DB. When I try to do that, it is giving me an error.

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Expected Output

My expected output is to have individual rows popup for each item in the array correspondingly. For example, the table will have three columns (ID, text, and values). I want the text[0] and values[0] to be populated in one row and the text[1] and values[1] to be populated in the second row, and so on.

Information on your n8n setup

  • n8n version: 0.231.3
  • Database: Postgres
  • n8n EXECUTIONS_PROCESS setting: main
  • Running n8n via: Docker
  • Operating system: Ubuntu Server 22.04 LTS

Hey @Jayavel,

It looks like the problem there is you only have one input item rather than 2 so it is trying to be clever, You would need to take your data and split it up into multiple items then insert it so something like this…

Hey @Jon,

Did you use a custom node for extracting the text and the values? Can you provide me the name/link to it?

Hey @Jayavel,

It wasn’t a custom node it was just an item lists node but it looks like we released an update to that node in the 0.234.0 release. I have updated the workflow example to use an older version of that node.

1 Like

Thank you @Jon, this is exactly what I wanted!

1 Like

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