Method: spreadsheets.values.append
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
स्प्रेडशीट में वैल्यू जोड़ता है. इनपुट रेंज का इस्तेमाल, मौजूदा डेटा को खोजने और उस रेंज में "टेबल" ढूंढने के लिए किया जाता है. वैल्यू, टेबल की अगली लाइन में जोड़ी जाएंगी. यह टेबल के पहले कॉलम से शुरू होगी. टेबल का पता लगाने और डेटा जोड़ने के तरीके के बारे में खास जानकारी के लिए, गाइड और सैंपल कोड देखें.
कॉल करने वाले को स्प्रेडशीट आईडी, रेंज, और valueInputOption
बताना होगा. valueInputOption
सिर्फ़ यह कंट्रोल करता है कि इनपुट डेटा को शीट में कैसे जोड़ा जाएगा (कॉलम के हिसाब से या लाइन के हिसाब से). इससे यह तय नहीं होता कि डेटा किस सेल में लिखा जाएगा.
एचटीटीपी अनुरोध
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}:append
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
पाथ पैरामीटर
पैरामीटर |
spreadsheetId |
string
अपडेट की जाने वाली स्प्रेडशीट का आईडी.
|
range |
string
डेटा की लॉजिकल टेबल खोजने के लिए, रेंज का A1 नोटेशन. वैल्यू, टेबल की आखिरी लाइन के बाद जोड़ी जाती हैं.
|
क्वेरी पैरामीटर
पैरामीटर |
valueInputOption |
enum (ValueInputOption )
इनपुट डेटा को कैसे समझा जाना चाहिए.
|
insertDataOption |
enum (InsertDataOption )
इनपुट डेटा को कैसे डालना चाहिए.
|
includeValuesInResponse |
boolean
यह तय करता है कि अपडेट के जवाब में, जोड़ी गई सेल की वैल्यू शामिल होनी चाहिए या नहीं. डिफ़ॉल्ट रूप से, जवाबों में अपडेट की गई वैल्यू शामिल नहीं होती हैं.
|
responseValueRenderOption |
enum (ValueRenderOption )
इससे यह तय होता है कि रिस्पॉन्स में वैल्यू को कैसे रेंडर किया जाना चाहिए. रेंडर करने का डिफ़ॉल्ट विकल्प FORMATTED_VALUE है.
|
responseDateTimeRenderOption |
enum (DateTimeRenderOption )
इससे यह तय होता है कि जवाब में तारीखों, समय, और अवधियों को कैसे रेंडर किया जाना चाहिए. अगर responseValueRenderOption FORMATTED_VALUE है, तो इसे अनदेखा कर दिया जाता है. dateTime के लिए रेंडर करने का डिफ़ॉल्ट विकल्प SERIAL_NUMBER है.
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में ValueRange
का उदाहरण है.
जवाब का मुख्य भाग
स्प्रेडशीट में वैल्यू की रेंज अपडेट करने पर मिलने वाला रिस्पॉन्स.
अगर एपीआई सही से जुड़ जाता है, ताे जवाब के मुख्य भाग में नीचे दिए गए स्ट्रक्चर शामिल होता है.
JSON के काेड में दिखाना |
{
"spreadsheetId": string,
"tableRange": string,
"updates": {
object (UpdateValuesResponse )
}
} |
फ़ील्ड |
spreadsheetId |
string
वह स्प्रेडशीट जिसमें अपडेट लागू किए गए थे.
|
tableRange |
string
टेबल की वह रेंज (A1 नोटेशन में), जिसमें वैल्यू जोड़ी जा रही हैं (वैल्यू जोड़ने से पहले). अगर कोई टेबल नहीं मिली, तो खाली रहेगा.
|
updates |
object (UpdateValuesResponse )
लागू किए गए अपडेट के बारे में जानकारी.
|
अनुमति के दायरे
इसके लिए, OAuth के इनमें से किसी एक स्कोप की ज़रूरत होती है:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets
ज़्यादा जानकारी के लिए, अनुमति से जुड़ी गाइड देखें.
InsertDataOption
इससे यह तय होता है कि नया डेटा डालने पर, मौजूदा डेटा में क्या बदलाव होगा.
Enums |
OVERWRITE |
नया डेटा, उन जगहों पर मौजूदा डेटा को ओवरराइट कर देता है जहां उसे लिखा जाता है. (ध्यान दें: शीट के आखिर में डेटा जोड़ने पर भी नई पंक्तियां या कॉलम जुड़ जाएंगे, ताकि डेटा डाला जा सके.) |
INSERT_ROWS |
नए डेटा के लिए लाइनें डाली जाती हैं. |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को 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.append\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 - [JSON representation](#body.AppendValuesResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [InsertDataOption](#InsertDataOption)\n- [Try it!](#try-it)\n\nAppends values to a spreadsheet. The input range is used to search for existing data and find a \"table\" within that range. Values will be appended to the next row of the table, starting with the first column of the table. See the [guide](https://developers.google.com/workspace/sheets/api/guides/values#appending_values) and [sample code](https://developers.google.com/workspace/sheets/api/samples/writing#append_values) for specific details of how tables are detected and data is appended.\n\nThe caller must specify the spreadsheet ID, range, and a [valueInputOption](/workspace/sheets/api/reference/rest/v4/ValueInputOption). The `valueInputOption` only controls how the input data will be added to the sheet (column-wise or row-wise), it does not influence what cell the data starts being written to.\n\n### HTTP request\n\n`POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}:append`\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 a range to search for a logical table of data. Values are appended after the last row of the table. |\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| `insertDataOption` | `enum (`[InsertDataOption](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/append#InsertDataOption)`)` How the input data should be inserted. |\n| `includeValuesInResponse` | `boolean` Determines if the update response should include the values of the cells that were appended. By default, responses do not include the updated values. |\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/append#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\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, \"tableRange\": string, \"updates\": { object (/workspace/sheets/api/reference/rest/v4/UpdateValuesResponse) } } ``` |\n\n| Fields ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| `spreadsheetId` | `string` The spreadsheet the updates were applied to. |\n| `tableRange` | `string` The range (in A1 notation) of the table that values are being appended to (before the values were appended). Empty if no table was found. |\n| `updates` | `object (`[UpdateValuesResponse](/workspace/sheets/api/reference/rest/v4/UpdateValuesResponse)`)` Information about the updates that were applied. |\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).\n\nInsertDataOption\n----------------\n\nDetermines how existing data is changed when new data is input.\n\n| Enums ||\n|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `OVERWRITE` | The new data overwrites existing data in the areas it is written. (Note: adding data to the end of the sheet will still insert new rows or columns so the data can be written.) |\n| `INSERT_ROWS` | Rows are inserted for the new data. |"]]