Postgres use array as a query parameters

Iā€™m making a sql query:

SELECT *
FROM order_items
WHERE order_id = $1 AND id IN (1120000532, 1120000533, 1120000534)

I want to use array from previous node output as a sql query parameters

[
  {
    "order_product_id": [
      "1120000532",
      "1120000533",
      "1120000534"
    ]
  }
]

Information on your n8n setup

  • n8n version: 1.22.6,

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Valdri

{{ $json.order_product_id.join(ā€˜,ā€™) }}

1 Like

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