Get array in the next node

I want to get the modifiedResults array in my next node.
How can I do this.

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:

Since you’re returning it from the code block, it’ll be automatically available in the next node.

But the json body is changing after I am using $input.all() or $json
{“json”: {“name”: “product”, “isDiscount”: “false”, “numberOfItems”: “1”, “measuringUnitName”: “dollar”, “currency”: “dollar”, “code”: “202”, “quantity”: 1, “taxPercentage”: 0.19, “price”: 84.02, “discountValue”: -8.4034, “isTaxIncluded”: “”}, “pairedItem”: {“item”: 0, “input”: 0}}

Like this
I only want body from name to istaxincluded
It is giving me json in the start and paireditems at the end how do I remove this
@mcnaveen

1 Like

Yeah, basically what your code does is. Initialize a new array, loop over every single item and add it to the newly created array, then return it.

i created a demo workflow of what is happening.

I don’t understand what your expected output is. Do you want to select a particular value?

also, it’ll be very helpful if you share your workflow.