I need help with refreshing tables that are connected to Google Sheets data inside Google Docs using the API. When I get the document data through the API, I can see all the table information but I cannot find any reference that connects it back to the original spreadsheet. The JSON response only shows the current text values from the cells, not the connection to the source sheet.
Here is what a sample table looks like in the API response with 2 rows containing “Math Skills” and “Science Skills”:
{
"tableData": {
"totalRows": 2,
"totalColumns": 1,
"rowData": [
{
"startPos": 45,
"endPos": 62,
"cellData": [
{
"startPos": 46,
"endPos": 62,
"cellContent": [
{
"startPos": 47,
"endPos": 62,
"textBlock": {
"textElements": [
{
"startPos": 47,
"endPos": 58,
"textContent": {
"text": "Math Skills",
"formatting": {
"bold": true,
"textColor": {
"colorValue": {
"rgbValues": {
"r": 0.2,
"g": 0.4,
"b": 0.9
}
}
},
"textSize": {
"value": 18,
"measurement": "PT"
},
"fontInfo": {
"name": "Calibri",
"style": 400
}
}
}
}
]
}
}
]
}
]
}
]
}
}
Basically I want to do the same thing as clicking the “REFRESH” button on a linked table but through code. Any ideas how to make this work?