Rename Keys in JSON Array

Hi there,

I would like to pass along some parameters in a json file, where I can specify which keys need to be renamed, for example:

[
  {
    "convert": [
      {
        "from": "first_name",
        "to": "FirstName"
      },
      {
        "from": "last_name",
        "to": "Surname"
      }
    ]
  }
]

I figured out that the Rename Keys node does not work with arrays, so I’m now looking for another creative solution.

Thanks in advance.

Hi @dickhoning

Can you try this workflow?

Hi @mcnaveen thanks for sharing this with me. What I’m really looking at, is to be able to create/fill this part of the code … .split(’"_id":’).join(’“id”:’) … dynamically from data in another json object.

In other words to get:

[
  {
    "convert": [
      {
        "from": "_id",
        "to": "id"
      }
      , more key mappings ...
    ]
  }
]

into here:

Screenshot 2022-02-13 at 20.36.20