Method: spreadsheets.values.batchClear
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
스프레드시트에서 하나 이상의 값 범위를 지웁니다. 호출자는 스프레드시트 ID와 하나 이상의 범위를 지정해야 합니다. 값만 삭제되고 셀의 다른 모든 속성 (예: 서식 및 데이터 유효성 검사)은 유지됩니다.
HTTP 요청
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchClear
URL은 gRPC 트랜스코딩 문법을 사용합니다.
경로 매개변수
매개변수 |
spreadsheetId |
string
업데이트할 스프레드시트의 ID입니다.
|
요청 본문
요청 본문에는 다음과 같은 구조의 데이터가 포함됩니다.
JSON 표현 |
{
"ranges": [
string
]
} |
필드 |
ranges[] |
string
삭제할 범위(A1 표기법 또는 R1C1 표기법)입니다.
|
응답 본문
스프레드시트에서 값 범위를 지울 때의 응답입니다.
성공한 경우 응답 본문은 다음과 같은 구조의 데이터를 포함합니다.
JSON 표현 |
{
"spreadsheetId": string,
"clearedRanges": [
string
]
} |
필드 |
spreadsheetId |
string
업데이트가 적용된 스프레드시트입니다.
|
clearedRanges[] |
string
삭제된 범위(A1 표기법) 요청이 경계가 없는 범위 또는 시트의 경계보다 큰 범위에 관한 경우, 시트의 한도에 경계가 지정된 삭제된 실제 범위입니다.
|
승인 범위
다음 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.batchClear\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.BatchClearValuesResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nClears one or more ranges of values from a spreadsheet. The caller must specify the spreadsheet ID and one or more ranges. Only values are cleared -- all other properties of the cell (such as formatting and data validation) are kept.\n\n### HTTP request\n\n`POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchClear`\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| ``` { \"ranges\": [ string ] } ``` |\n\n| Fields ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------|\n| `ranges[]` | `string` The ranges to clear, in [A1 notation or R1C1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell). |\n\n### Response body\n\nThe response when clearing 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, \"clearedRanges\": [ string ] } ``` |\n\n| Fields ||\n|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `spreadsheetId` | `string` The spreadsheet the updates were applied to. |\n| `clearedRanges[]` | `string` The ranges that were cleared, in A1 notation. If the requests are for an unbounded range or a ranger larger than the bounds of the sheet, this is the actual ranges that were cleared, bounded to the sheet's limits. |\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)."]]