Method: spreadsheets.values.update
HTTP 要求
PUT https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
spreadsheetId |
string
要更新的試算表 ID。
|
range |
string
要更新的值的 A1 標記法。
|
查詢參數
參數 |
valueInputOption |
enum (ValueInputOption )
如何解讀輸入資料。
|
includeValuesInResponse |
boolean
決定更新回應是否應包含已更新的儲存格值。根據預設,回應不會包含更新的值。如果要寫入的範圍大於實際寫入的範圍,則回應會包含要求範圍內的所有值 (不含結尾的空資料列和資料欄)。
|
responseValueRenderOption |
enum (ValueRenderOption )
決定回應中值的呈現方式。預設的轉譯選項為 FORMATTED_VALUE 。
|
responseDateTimeRenderOption |
enum (DateTimeRenderOption )
決定回應中日期、時間和持續時間的顯示方式。如果 responseValueRenderOption 是 FORMATTED_VALUE ,系統會忽略這個項目。預設的 dateTime 轉譯選項為 SERIAL_NUMBER 。
|
要求主體
要求主體包含 ValueRange
的例項。
回應主體
如果成功,回應主體會包含 UpdateValuesResponse
的執行例項。
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-05 (世界標準時間)。
[null,null,["上次更新時間:2024-09-05 (世界標準時間)。"],[[["This method allows you to set values within a specified range of a Google Sheet using the provided spreadsheet ID, range, and value input option."],["You can control data interpretation, response inclusion of updated values, value rendering, and date/time rendering through query parameters."],["The request body requires a ValueRange object defining the values to be set, while a successful response returns an UpdateValuesResponse object."],["Authorization is necessary using one of the specified OAuth scopes: `https://www.googleapis.com/auth/drive`, `https://www.googleapis.com/auth/drive.file`, or `https://www.googleapis.com/auth/spreadsheets`."]]],["This outlines updating spreadsheet values using a `PUT` request to the Google Sheets API. Key actions include specifying the `spreadsheetId` and `range` in the URL's path parameters. The request requires a `valueInputOption` in the query parameters to define data interpretation. Optional query parameters allow controlling response content and formatting. The request body uses `ValueRange`, and a successful response includes `UpdateValuesResponse`. Authorization requires specific OAuth scopes: `drive`, `drive.file`, or `spreadsheets`.\n"]]