Method: spreadsheets.values.batchUpdate
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
HTTP 요청
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchUpdate
URL은 gRPC 트랜스코딩 문법을 사용합니다.
경로 매개변수
매개변수 |
spreadsheetId |
string
업데이트할 스프레드시트의 ID입니다.
|
요청 본문
요청 본문에는 다음과 같은 구조의 데이터가 포함됩니다.
필드 |
valueInputOption |
enum (ValueInputOption )
입력 데이터가 해석되어야 하는 방식입니다.
|
data[] |
object (ValueRange )
스프레드시트에 적용할 새 값입니다.
|
includeValuesInResponse |
boolean
업데이트 응답에 업데이트된 셀의 값을 포함할지 여부를 결정합니다. 기본적으로 응답에는 업데이트된 값이 포함되지 않습니다. 각 BatchUpdateValuesResponse.responses 내의 updatedData 필드에는 업데이트된 값이 포함됩니다. 작성할 범위가 실제로 작성된 범위보다 큰 경우 응답에는 요청된 범위의 모든 값 (마지막 빈 행 및 열 제외)이 포함됩니다.
|
responseValueRenderOption |
enum (ValueRenderOption )
응답의 값을 렌더링하는 방법을 결정합니다. 기본 렌더링 옵션은 FORMATTED_VALUE 입니다.
|
responseDateTimeRenderOption |
enum (DateTimeRenderOption )
응답의 날짜, 시간, 기간을 렌더링하는 방법을 결정합니다. responseValueRenderOption 가 FORMATTED_VALUE 이면 무시됩니다. 기본 dateTime 렌더링 옵션은 SERIAL_NUMBER 입니다.
|
응답 본문
스프레드시트에서 값 범위를 업데이트할 때의 응답입니다.
성공한 경우 응답 본문은 다음과 같은 구조의 데이터를 포함합니다.
JSON 표현 |
{
"spreadsheetId": string,
"totalUpdatedRows": integer,
"totalUpdatedColumns": integer,
"totalUpdatedCells": integer,
"totalUpdatedSheets": integer,
"responses": [
{
object (UpdateValuesResponse )
}
]
} |
필드 |
spreadsheetId |
string
업데이트가 적용된 스프레드시트입니다.
|
totalUpdatedRows |
integer
행의 셀이 하나 이상 업데이트된 총 행 수입니다.
|
totalUpdatedColumns |
integer
열의 셀이 하나 이상 업데이트된 총 열 개수입니다.
|
totalUpdatedCells |
integer
업데이트된 총 셀 수입니다.
|
totalUpdatedSheets |
integer
시트의 셀이 하나 이상 업데이트된 시트의 총 개수입니다.
|
responses[] |
object (UpdateValuesResponse )
요청된 범위당 하나의 UpdateValuesResponse가 요청이 표시된 순서대로 포함됩니다.
|
승인 범위
다음 OAuth 범위 중 하나가 필요합니다.
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets
자세한 내용은 승인 가이드를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-03-22(UTC)
[null,null,["최종 업데이트: 2025-03-22(UTC)"],[],[],null,["# Method: spreadsheets.values.batchUpdate\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.BatchUpdateValuesResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nSets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a [valueInputOption](/workspace/sheets/api/reference/rest/v4/ValueInputOption), and one or more [ValueRanges](/workspace/sheets/api/reference/rest/v4/spreadsheets.values#ValueRange).\n\n### HTTP request\n\n`POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchUpdate`\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\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"valueInputOption\": enum (/workspace/sheets/api/reference/rest/v4/ValueInputOption), \"data\": [ { object (/workspace/sheets/api/reference/rest/v4/spreadsheets.values#ValueRange) } ], \"includeValuesInResponse\": boolean, \"responseValueRenderOption\": enum (/workspace/sheets/api/reference/rest/v4/ValueRenderOption), \"responseDateTimeRenderOption\": enum (/workspace/sheets/api/reference/rest/v4/DateTimeRenderOption) } ``` |\n\n| Fields ||\n|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `valueInputOption` | `enum (`[ValueInputOption](/workspace/sheets/api/reference/rest/v4/ValueInputOption)`)` How the input data should be interpreted. |\n| `data[]` | `object (`[ValueRange](/workspace/sheets/api/reference/rest/v4/spreadsheets.values#ValueRange)`)` The new values to apply to the spreadsheet. |\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. The `updatedData` field within each of the [BatchUpdateValuesResponse.responses](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchUpdate#body.BatchUpdateValuesResponse.FIELDS.responses) contains 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/batchUpdate#body.request_body.FIELDS.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### Response body\n\nThe response when updating a range of values in a spreadsheet.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"spreadsheetId\": string, \"totalUpdatedRows\": integer, \"totalUpdatedColumns\": integer, \"totalUpdatedCells\": integer, \"totalUpdatedSheets\": integer, \"responses\": [ { object (/workspace/sheets/api/reference/rest/v4/UpdateValuesResponse) } ] } ``` |\n\n| Fields ||\n|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `spreadsheetId` | `string` The spreadsheet the updates were applied to. |\n| `totalUpdatedRows` | `integer` The total number of rows where at least one cell in the row was updated. |\n| `totalUpdatedColumns` | `integer` The total number of columns where at least one cell in the column was updated. |\n| `totalUpdatedCells` | `integer` The total number of cells updated. |\n| `totalUpdatedSheets` | `integer` The total number of sheets where at least one cell in the sheet was updated. |\n| `responses[]` | `object (`[UpdateValuesResponse](/workspace/sheets/api/reference/rest/v4/UpdateValuesResponse)`)` One UpdateValuesResponse per requested range, in the same order as the requests appeared. |\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)."]]