Method: spreadsheets.values.batchUpdate
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
स्प्रेडशीट की एक या उससे ज़्यादा रेंज में वैल्यू सेट करता है. कॉलर को स्प्रेडशीट आईडी, एक valueInputOption
, और एक या उससे ज़्यादा ValueRanges
बताने होंगे.
एचटीटीपी अनुरोध
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchUpdate
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
पाथ पैरामीटर
पैरामीटर |
spreadsheetId |
string
अपडेट की जाने वाली स्प्रेडशीट का आईडी.
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में नीचे दिए गए स्ट्रक्चर वाला डेटा होता है:
फ़ील्ड |
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 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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)."]]