When you create the API key in the private app, inside the CURL you have
“tableName”: “Contractors”,
This identifies the name of the sheet. It seems like this name is generated at the time the sheet is created and placed into the API.
If you subsequently change the name of the sheet to another name then the “tablename” in the CURL does NOT seem to change/update, we tested the API and it works with the old tablename
Not sure if it is easy for the tablename to be updated when you change it in glidetables, otherwise would there be an issue if you later you created another table with the old name ?
You’re absolutely right. The API will grab the original TABLE name.
Same is true with the COLUMN names. If you know you’re going to use API on a table, it’s best to clear all the columns and start afresh making sure you’re naming them exactly how you’ll want them referenced.
We are actually doing direct API call the google sheet, reading the data from the sheet and inserting it into a backup DB. We are then using the GLIDE API to delete the data in GLIDE once it is backed up (we could have just delete it in Google sheets).
If there was a read endpoint for GLIDE that would be handy, we only see (ADD, UPDATE, DELETE)
By the way, I now have lots of empty rows in my google sheets. I know how to manually delete the empty rows, but is there an automatic way ? All so if I don’t delete them will it max out the google sheet row limit ?
There is, but at the moment it’s only available to Enterprise customers.
I use a bit of apps script for this. Here’s an example you could adapt:
function remove_empty_rows() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('YOUR SHEET NAME GOES HERE');
var headers = sheet.getRange(1,1,1,sheet.getLastColumn()).getValues().shift();
var concat_index = headers.indexOf('CHANGE THIS');
var uuid_index = headers.indexOf('CHANGE THIS ALSO');
var data = sheet.getRange(2,1,sheet.getLastRow()-1,sheet.getLastColumn()).getValues();
var row = sheet.getLastRow();
while (row > 2) {
var rec = data.pop();
var concat = rec[concat_index];
var uuid = rec[uuid_index];
if (concat == "" && uuid == "") {
console.log("deleting row %s", row);
sheet.deleteRow(row);
}
row--;
}
}
Basically with the above, I just picked two columns that I know should never be empty, and if both of them are then the row gets deleted.
As long as they don’t contain any formulas, Glide will ignore them and they won’t count.