Method: spreadsheets.values.update
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
HTTP リクエスト
PUT https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
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
詳しくは、認可ガイドをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-03-22 UTC。
[null,null,["最終更新日 2025-03-22 UTC。"],[],[],null,["# Method: spreadsheets.values.update\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nSets values in a range of a spreadsheet. The caller must specify the spreadsheet ID, range, and a [valueInputOption](/workspace/sheets/api/reference/rest/v4/ValueInputOption).\n\n### HTTP request\n\n`PUT https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------|\n| `spreadsheetId` | `string` The ID of the spreadsheet to update. |\n| `range` | `string` The [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell) of the values to update. |\n\n### Query parameters\n\n| Parameters ||\n|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `valueInputOption` | `enum (`[ValueInputOption](/workspace/sheets/api/reference/rest/v4/ValueInputOption)`)` How the input data should be interpreted. |\n| `includeValuesInResponse` | `boolean` Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. If the range to write was larger than the range actually written, the response includes all values in the requested range (excluding trailing empty rows and columns). |\n| `responseValueRenderOption` | `enum (`[ValueRenderOption](/workspace/sheets/api/reference/rest/v4/ValueRenderOption)`)` Determines how values in the response should be rendered. The default render option is [FORMATTED_VALUE](/workspace/sheets/api/reference/rest/v4/ValueRenderOption). |\n| `responseDateTimeRenderOption` | `enum (`[DateTimeRenderOption](/workspace/sheets/api/reference/rest/v4/DateTimeRenderOption)`)` Determines how dates, times, and durations in the response should be rendered. This is ignored if [responseValueRenderOption](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/update#body.QUERY_PARAMETERS.response_value_render_option) is [FORMATTED_VALUE](/workspace/sheets/api/reference/rest/v4/ValueRenderOption). The default dateTime render option is [SERIAL_NUMBER](/workspace/sheets/api/reference/rest/v4/DateTimeRenderOption). |\n\n### Request body\n\nThe request body contains an instance of [ValueRange](/workspace/sheets/api/reference/rest/v4/spreadsheets.values#ValueRange).\n\n### Response body\n\nIf successful, the response body contains an instance of [UpdateValuesResponse](/workspace/sheets/api/reference/rest/v4/UpdateValuesResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/drive`\n- `https://www.googleapis.com/auth/drive.file`\n- `https://www.googleapis.com/auth/spreadsheets`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]