JSON OBJECTS in a POST HTTP request

Describe the problem/error/question

I want to use an array of objects to post via an HTTP request to another system. but, the formatting of the object i get back is unusable.

am i doing something wrong?

Please share your workflow

i’m expecting something like this:
[
{
“Description”: “Consultancy”,
“UnitPriceExcl”: 63,
“Quantity”: 1
},
{
“Description”: “Consultancy”,
“UnitPriceExcl”: 64,
“Quantity”: 1
}
]

but getting when i call it:
[Array: [{“json”: {“Description”: “Consultancy”, “UnitPriceExcl”: 63, “Quantity”: 1}, “pairedItem”: {“item”: 0}},{“json”: {“Description”: “Consultancy”, “UnitPriceExcl”: 64, “Quantity”: 1}, “pairedItem”: {“item”: 1}}]]

any tips? am i calling it the wrong way?

N8N: 1.20
DB : SQLite
Docker
Debian

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:

@Tontonsam , the result you are getting is expected. What is missing is the aggregation of the items into an array. Here’s how this could be done.

2 Likes

great, thats what i needed! thanks a lot!

1 Like

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