Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google api 批量更新不工作_Google Api_Google Sheets_Google Drive Api_Google Spreadsheet Api_Google Docs Api - Fatal编程技术网

Google api 批量更新不工作

Google api 批量更新不工作,google-api,google-sheets,google-drive-api,google-spreadsheet-api,google-docs-api,Google Api,Google Sheets,Google Drive Api,Google Spreadsheet Api,Google Docs Api,我们正在使用Google电子表格中的批更新更新多个单元格。最近几天,我们看到一些用户的某些行在几天内没有更新,然后正常工作。我将准确地解释用例 例如,在一张工作表中,Google Sheets batch update会将内容添加到71行(这可以是任何数字。以71为例),我们尝试更新第72行,但它不会更新,也不会出现任何异常。第72行将为空,即使我们尝试多次,也不会更新。但是,如果我们尝试在第73行上方添加一些内容,它将起作用。它可能在第156行的某个地方再次失败(随机)。几天后,如果我们尝试在

我们正在使用Google电子表格中的批更新更新多个单元格。最近几天,我们看到一些用户的某些行在几天内没有更新,然后正常工作。我将准确地解释用例

例如,在一张工作表中,Google Sheets batch update会将内容添加到71行(这可以是任何数字。以71为例),我们尝试更新第72行,但它不会更新,也不会出现任何异常。第72行将为空,即使我们尝试多次,也不会更新。但是,如果我们尝试在第73行上方添加一些内容,它将起作用。它可能在第156行的某个地方再次失败(随机)。几天后,如果我们尝试在第72行添加内容,它将正常工作

请帮助我们解决此问题。这是我们正在使用的代码

// Prepare the update
CellFeed batchRequest = new CellFeed();
    for (CellInfo cellAddr : cellAddrs) {
         CellEntry batchEntry = new CellEntry(cellAddr.row, cellAddr.col, cellAddr.idString);
          batchEntry.setId(String.format("%s/%s", worksheet.getCellFeedUrl().toString(), cellAddr.idString));         
          BatchUtils.setBatchId(batchEntry, cellAddr.idString);
          BatchUtils.setBatchOperationType(batchEntry, BatchOperationType.UPDATE);  
          batchRequest.getEntries().add(batchEntry);

    }
// Submit the update
CellFeed cellfeed = service.getFeed(cellFeedUrl, CellFeed.class);
    Link batchLink = cellfeed.getLink(Link.Rel.FEED_BATCH, Link.Type.ATOM);
    URL batchUrl = new URL(batchLink.getHref());
    service.setHeader("If-Match", "*");
    CellFeed batchResponse = service.batch(batchUrl, batchRequest);
    service.setHeader("If-Match", "*");

请张贴您的密码。很难理解为什么有些行没有被更新。我在这里添加了代码片段和用例的解释。你可能想与谷歌讨论一个问题。大张纸往往会导致问题,所以您可以尝试拆分成较小的纸。但是我的第一个猜测是数据,你确定你写的数据没有什么奇怪的地方吗。此外,我确实会在API中遇到错误,可能50次写入中有1次会失败,所以我会重新尝试(但我遇到超时错误,所以听起来不一样)