Based on this answer:
Move a sheet to a particular position using Python & the Google Sheets API
I wrote this piece of code:
body = {'requests': [
{'updateSheetProperties': {
'properties': {
'sheetId': sheetId,
'index': 1
}
}}
]}
spreadsheet.batch_update(body)
But I am getting this error:
"Invalid requests[0].updateSheetProperties: At least one field must be listed in 'fields'. (Use '*' to indicate all fields.)"
If I add this:
body = {'requests': [
{'updateSheetProperties': {
'properties': {
'sheetId': sheetId,
'index': 1
},
"fields": "*"
}}
]}
I get:
"Invalid requests[0].updateSheetProperties: The sheet name cannot be empty."
I even tried with my sheet name:
"fields": "2019-08-09"
But I get:
"Invalid requests[0].updateSheetProperties: Invalid field: 2019-08-09"
Any suggestions?