基于此答案:
Move a sheet to a particular position using Python & the Google Sheets API
我写了这段代码:
body = {'requests': [
{'updateSheetProperties': {
'properties': {
'sheetId': sheetId,
'index': 1
}
}}
]}
spreadsheet.batch_update(body)
但是我收到此错误:
“无效请求[0] .updateSheetProperties:必须在“字段”中列出至少一个字段。(使用“ *”表示所有字段。)”
如果我添加此内容:
body = {'requests': [
{'updateSheetProperties': {
'properties': {
'sheetId': sheetId,
'index': 1
},
"fields": "*"
}}
]}
我得到:
“无效请求[0]。updateSheetProperties:工作表名称不能为空。”
我什至尝试使用工作表名称:
"fields": "2019-08-09"
但是我得到了
“无效请求[0] .updateSheetProperties:无效字段:2019-08-09”
有什么建议吗?
答案 0 :(得分:1)
Handler().postDelayed({
mAddressEditText.setText(place.getAddress());
}, 300)
的gspread。如果我的理解是正确的,那么该修改如何?
在此修改中,batch_update
被修改。
body
至:
body = {'requests': [
{'updateSheetProperties': {
'properties': {
'sheetId': sheetId,
'index': 1
}
}}
]}
body = {'requests': [
{'updateSheetProperties': {
'properties': {
'sheetId': sheetId,
'index': 1
},
'fields': 'index',
}}
]}
至index
。要同时移动工作表并重命名工作表名称时,请使用以下请求正文。
fields
如果我误解了您的问题,而这不是您想要的方向,我深表歉意。