How to merge rows with same data

Is there a possibility to merge the same data into one row but keep other data separate?

Example:
This is simplified
image

to this:
image

JSON example:
[
{
“Task”: “123”,
“Date”: “2024-11-14 09:51:00”,
“User”: “Jake”,
“Client”: “Shop”,
“Code”: “111”,
“Action”: “Installed”,
“Serial number”: “12345.”,
},
{
“Task”: “123”,
“Date”: “2024-11-14 09:51:00”,
“User”: “Jake”,
“Client”: “Shop”,
“Code”: “222”,
“Action”: “Removed”,
“Serial number”: “54321.”,
}
]

  • **n8n version: 1.56.2
  • **Running n8n via desktop app
  • **Operating system: Windows

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:

Welcome to the community @Nikol !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.

Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!


What you are asking for implies JSON with an array of sub-data as one of the properties.

That is it mean aggregating the data in some way. For example, your original data

[
  {
    "Task": "123",
    "Date": "2024-11-14 09:51:00",
    "User": "Jake",
    "Client": "Shop",
    "Code": "111",
    "Action": "Installed",
    "Serial number": "12345"
  },
  {
    "Task": "123",
    "Date": "2024-11-14 09:51:00",
    "User": "Jake",
    "Client": "Shop",
    "Code": "222",
    "Action": "Removed",
    "Serial number": "54321"
  }
]

would be converted to

[
  {
    "Task": "123",
    "Date": "2024-11-14 09:51:00",
    "User": "Jake",
    "Client": "Shop",
    "Code": [
      "111",
      "222"
    ],
    "Action": [
      "Installed",
      "Removed"
    ],
    "Serial number": [
      "12345",
      "54321"
    ]
  }
]

This could be achieved in the way demostrated in the workflow below.

1 Like

Thank you for your answer

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