I ask for some help and advice to save a JSON array to a sheet.
I fetch data from an API and parse it to JSON as shown below:
The count (3) will be the number of rows written to the sheet.
I want to write some of the items, e.g. "date", "totalActivePower", "temperature" as the column headings, into "count" rows.
I'm resonably OK with handling the sheet, but just can't seem to extract the data as above.
Help from the community would be most welcome
{
"data": {
"count": 3,
"telemetries": [
{
"date": "2025-02-22 13:49:45",
"totalActivePower": 1967,
"dcVoltage": 366.812,
"groundFaultResistance": 6000,
"powerLimit": 100,
"totalEnergy": 24116700,
"temperature": 24.6502,
"inverterMode": "MPPT",
"operationMode": 0,
"L1Data": {
"acCurrent": 8.13281,
"acVoltage": 242.984,
"acFrequency": 50.0975,
"apparentPower": 1972.5,
"activePower": 1967,
"reactivePower": 147.5,
"cosPhi": 1
}
},
{
"date": "2025-02-22 13:54:45",
"totalActivePower": 584,
"dcVoltage": 369.312,
"groundFaultResistance": 6000,
"powerLimit": 100,
"totalEnergy": 24116800,
"temperature": 24.3047,
"inverterMode": "MPPT",
"operationMode": 0,
"L1Data": {
"acCurrent": 2.41406,
"acVoltage": 244.406,
"acFrequency": 50.1134,
"apparentPower": 590,
"activePower": 584,
"reactivePower": 80,
"cosPhi": 1
}
},
{
"date": "2025-02-22 13:59:45",
"totalActivePower": 588,
"dcVoltage": 369,
"groundFaultResistance": 6000,
"powerLimit": 100,
"totalEnergy": 24116900,
"temperature": 23.8055,
"inverterMode": "MPPT",
"operationMode": 0,
"L1Data": {
"acCurrent": 2.42969,
"acVoltage": 244.641,
"acFrequency": 49.9722,
"apparentPower": 593,
"activePower": 588,
"reactivePower": -73,
"cosPhi": 1
}
}
]
}
}