How i can extract all name products field from json

HI, I have really simply workflow, where I want extract all name product fields from api. From http request I connect to the API and I try find some node which gonna help me. I will try to use Edite Field (Set) but on thi way I can get only one filed with product name. In json from api I have many of products. Can anybody help me ?

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:1.91.2
  • **Database (default: SQLite):any output
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):main
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):cloud
  • Operating system:

probably something like .map(item => item.product_name)

Hi @lukomotive

This can be done with an expression and also with the use of some nodes.
For using nodes in a lowcode way you need to use the split node to split that list and a set node to keep only the name and after you can aggregate the names with the aggregate node.

With an expression it is this expression(unverified)

{{ $json.list.map(x=>x.translations).flatMap(x=>Object.values(x)).map(x=>x.name) }}

Not sure your expected output
But I give two solutions.


1 Like

THX, your solution is working very well !! :heart:

2 Likes