【发布时间】:2021-02-08 09:15:16
【问题描述】:
我很难使用 pygsheets 在我的 Google 电子表格文档中设置数据验证。我找到了这个功能:
wks.set_data_validation((startIndex, wks.get_named_ranges("stdArbeitsauftrag").start_addr[1]), condition_type='ONE_OF_RANGE', condition_values='=CONFIG!E3:E')
# wks is my current worksheet
# startIndex is the cell to start
# wks.get_named_ranges("stdArbeitsauftrag").start_addr[1]) should be the same column as in startIndex, but does not work (it works with set_dataframe though) - I will take care of this later
# condition_type='ONE_OF_RANGE' should define a range of values
# condition_values='=CONFIG!E3:E' is the range of value in the same document
调用它会引发 400 文本错误:
返回“无效请求 [0].setDataValidation:ConditionType 'ONE_OF_RANGE' 只需要一个 ConditionValue,但提供了 12 个值。”。详细信息:“无效请求 [0].setDataValidation:ConditionType 'ONE_OF_RANGE' 只需要一个 ConditionValue,但提供了 12 个值。”
有人可以帮忙吗?
最好的问候, 曼努埃尔
【问题讨论】:
标签: python python-3.x google-sheets google-drive-api pygsheets