无法使Google Sheets API v4使用batchGet返回多个范围值。它给出了以下错误(尽管文档说它需要valueRanges [],所有范围和电子表格ID都是正确的):“额外的args块必须是javascript对象文字。(第2行,文件“代码”)”
您能帮忙解决一下吗?谢谢。这是代码:
function readRange(spreadsheetId) {
var response = Sheets.Spreadsheets.Values.batchGet("someSpreadSheetID", ["Sheet1!D7:F7", "Sheet1!J7:L7"]);
Logger.log(response.values);
}
Run Code Online (Sandbox Code Playgroud) 无法为 获得正确/正确的语法Values.update,Google 文档中没有 Google Apps 脚本的代码示例。尝试使用将batchUpdate范围限制为一个的代码模式,但它不起作用。任何人都可以请建议正确的语法Values.update吗?这是代码:
function updateOneCell() {
var spreadsheetId = "someSpreadsheetId";
var request = {
"valueInputOption": "USER_ENTERED",
"data": [
{
"range": "Sheet1!BW7",
"majorDimension": "ROWS",
"values": [[new Date()]]
}
]
};
Sheets.Spreadsheets.Values.update(request, spreadsheetId);
}
Run Code Online (Sandbox Code Playgroud)
它给出了以下错误:
提供的参数数量无效。预计 3-4 只
谢谢你。
无法从 Google Apps 脚本获取 Google Sheets API v4 代码来将命名/受保护的范围添加到 Google 表格,请使用此处的代码示例 [[link]][1]。它给出了错误(正确的 json 形式是什么?):
收到无效的 JSON 负载。未知名称“请求”:找不到字段。(第 5 行,文件“代码”)
下面是代码:
function protectSheet() {
var sheetId = "sheet id";
var spreadsheetId = "spreadsheet id";
Sheets.Spreadsheets.Values.batchUpdate(
{
"requests": [
{
"addNamedRange": {
"namedRange": {
"name": "Counts",
"range": {
"sheetId": sheetId,
"startRowIndex": 0,
"endRowIndex": 3,
"startColumnIndex": 0,
"endColumnIndex": 5,
},
}
}
},
{
"addProtectedRange": {
"protectedRange": {
"range": {
"sheetId": sheetId,
"startRowIndex": 3,
"endRowIndex": 4,
"startColumnIndex": 0,
"endColumnIndex": 5,
},
"description": "Protecting …Run Code Online (Sandbox Code Playgroud) javascript google-sheets google-apps-script google-sheets-api
适用于Google Apps脚本的Google表格API v4方法spreadsheets.values.append的正确语法是什么?
尝试以下代码,但它给出了一个错误: Invalid JSON payload received.
function appendRow() {
Sheets.Spreadsheets.Values.append("SpreadsheetID", "Sheet1!A:A", "USER_ENTERED", { "values": [[new Date()]] } );
}
Run Code Online (Sandbox Code Playgroud)
谢谢.
google-sheets google-apps-script google-apis-explorer google-sheets-api
为什么Bootstrap-select不能正常使用Bootstrap 4?这是代码,它将搜索输入按钮和选项分别显示为两个单独的按钮。
<select class="selectpicker" data-live-search="true">
<option data-tokens="ketchup mustard">Hot Dog, Fries and a Soda</option>
<option data-tokens="mustard">Burger, Shake and a Smile</option>
<option data-tokens="frosting">Sugar, Spice and all things nice</option>
</select>
Run Code Online (Sandbox Code Playgroud)