Mapping Specific Line Items within JSON Array

Describe the problem/error/question

I am trying to map all the “description” values within below JSON array:

[
  {
    "line_items": [
      {
        "name": "\"Kawaii\" هودي اصنع سعادتك بنفسك - XS",
        "price": "145.00",
        "quantity": 1
      },
      {
        "name": "التيشيرت يعتبر من الأساسيات بالنسبة لي - Black / XS",
        "price": "89.00",
        "quantity": 1
      }
    ]
  }
]

using below JSON code:

{{ $('New Paid Order').item.json.line_items.map(li => ({ description: li.name })) }}

However, whenever I try to do this, I get below result:

[object Object],[object Object]

I’ve searched a lot but couldn’t find any solution for this. See below expected results:

[
  {
    "description": "\"Kawaii\" هودي اصنع سعادتك بنفسك - XS"
  },
  {
    "description": "التيشيرت يعتبر من الأساسيات بالنسبة لي - Black / XS"
  }
]

Thank You

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

hello @Hussain_Alkhamees

Please, share the workflow.

You can select all nodes with Ctrl+A and copy them with Ctrl+C. Then, past the content after pressing the button </> with Ctrl+V.