Struggling to fetch data from a Firebase Realtime database and pass it into Google Spreadsheets as JSON objects. Any help would be greatly appreciated.
Here is the structure of my Firebase Realtime database:
{
"4rjF1iwudEXEevtzEoGwDrEtEpI3":
{
"agg1":true,
"agg2":true,
"category":"Solo"
},
"8I71pW0JXqflBQf5YMBdJ0kv8F13":
{
"agg1":true,
"agg2":true,
"category":"Trio"
}
}
I have attempted to map the data using the following code:
var itemArray = [];
var valueArray = [];
Object.keys(data).forEach((key, index) => {
itemArray.push(key);
itemArray.push(data[key]);
valueArray[index] = itemArray;
itemArray = [];
});