I am trying to set two seperate arrays(headers & rows) to be equal to the response of the query I am making.
let dataProp = {}
// I make the query
var query2 = new google.visualization.Query('https://docs.google.com/spreadsheets/d/1xEz5wfWSwXbAgWhgvJxfxSDhNGf5w8hqVpAFbbAViEo/gviz/tq?tqx=out:json&sheet=Sheet2')
// I send the query to a function to be handled
query2.send(handleQueryResponse2)
function handleQueryResponse2(response) {
// I want to inspect the response (shown below in image)
console.log(response.getDataTable())
data2 = response.getDataTable()
dataProp.table2 = { rows: [...data2.fg] }
// let's put this loop aside (this sanitizes the content in same data type.)
for (let i = 0; i < data2.fg.length; i++) {
let tempRow = [];
for (let j = 0; j < data2.fg[i].c.length; j++) {
tempRow[j] = cleanRowsContent(dataProp.table2.rows[i].c[j])
}
dataProp.table2.rows[i] = tempRow
}
}
Response of the query in console:
Problem : Like shown in code, I want to grab the headers and rows like shown below BUT the values "If" & "fg" changes with updates (to "Fg" & "hg" and so on...) and I constantly have to check if my code is still working... Can someone explain me how I can fix this?
A little more context : I am using Google visualisation tools (to make multiple queries) because it is 97% lighter than the traditional jquery api format available
