Method: spreadsheets.values.batchClear
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
یک یا چند محدوده از مقادیر را از یک صفحه گسترده پاک می کند. تماس گیرنده باید شناسه صفحه گسترده و یک یا چند محدوده را مشخص کند. فقط مقادیر پاک می شوند -- تمام خصوصیات دیگر سلول (مانند قالب بندی و اعتبارسنجی داده ها) حفظ می شوند.
درخواست HTTP
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchClear
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای مسیر
پارامترها |
---|
spreadsheetId | string شناسه صفحهگسترده برای بهروزرسانی. |
درخواست بدن
بدنه درخواست حاوی داده هایی با ساختار زیر است:
نمایندگی 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 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-03-21 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-03-21 بهوقت ساعت هماهنگ جهانی."],[],[],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)."]]