Add id auto-increment

Hello everyone,

Do you have a solution to go from this json :

[
{
“content”: “example”
},
{
“content”: “example”
}
]

To this json :

[
{
“id”: “1”
“content”: “example”
},
{
“id”: “2”
“content”: “example”
}
]

The id should be self-incrementing

Thank you in advance, have a nice day

Hi @albaninho,

You can use Javascript code in Function Node to achieve this.

Here is a quick example

1 Like