Rename JSON Fields in n8n
When working with APIs, the data you receive often has field names that don't match what you need. A field might be called temp when you want temperature_celsius, or nested deep inside the response when you need it at the top level.
The Edit Fields (Set) node lets you reshape data by creating new fields, renaming existing ones, or extracting values from nested structures. It's one of the most commonly used nodes in n8n.
In this challenge, you'll fetch weather data and transform the nested API response into a flat, clearly-named structure.
What you'll practice:
- Using the Edit Fields (Set) node to create new fields
- Referencing incoming data with expressions like
$json.fieldName - Extracting nested data into a flat structure
- Concatenating values in expressions
Your Task
- 1Copy the exercise below
- 2Paste into your n8n editor (Ctrl+V)
- 3Solve it — use hints if you get stuck
- 4Check the solution when done
Fetch current weather data from https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41¤t_weather=true and extract the nested fields into a flat, clearly-named output:
temperature_celsius: The current temperature (fromcurrent_weather.temperature)wind_kmh: The wind speed (fromcurrent_weather.windspeed)coordinates: Combine latitude and longitude in standard format (e.g.,"52.52, 13.42")
Expected output format:
{
"temperature_celsius": 4.7,
"wind_kmh": 6.7,
"coordinates": "52.52, 13.42"
}
Get the exercise workflow
Create a free account to copy exercises into your n8n editor.