Rename a JSON value from node

I am sorry to ask this question but I can’t find the right answer, because I don’t know how to define the question.

I would like to use a “function node” to rename a value from the previous “weather note”:

Can somebody give me a hint? Thank you!

The example below should do it.

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "locationSelection": "cityId",
        "cityId": 6077243,
        "language": "en"
      },
      "name": "OpenWeatherMap",
      "type": "n8n-nodes-base.openWeatherMap",
      "typeVersion": 1,
      "position": [
        540,
        300
      ],
      "credentials": {
        "openWeatherMapApi": "asasas"
      }
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "weather[0].description",
              "value": "new description"
            }
          ]
        },
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        740,
        300
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "OpenWeatherMap",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenWeatherMap": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
1 Like

Awesome! Thanks for the quick response!

1 Like