Method: spreadsheets.values.append
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
스프레드시트에 값을 추가합니다. 입력 범위는 기존 데이터를 검색하고 해당 범위 내에서 '표'를 찾는 데 사용됩니다. 값은 테이블의 첫 번째 열부터 테이블의 다음 행에 추가됩니다. 테이블이 감지되고 데이터가 추가되는 방법에 관한 자세한 내용은 가이드 및 샘플 코드를 참고하세요.
호출자는 스프레드시트 ID, 범위, valueInputOption
를 지정해야 합니다. valueInputOption
는 입력 데이터가 시트에 추가되는 방식 (열 단위 또는 행 단위)만 제어하며 데이터가 쓰기 시작하는 셀에는 영향을 미치지 않습니다.
HTTP 요청
POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}:append
URL은 gRPC 트랜스코딩 문법을 사용합니다.
경로 매개변수
매개변수 |
spreadsheetId |
string
업데이트할 스프레드시트의 ID입니다.
|
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
새 데이터가 입력될 때 기존 데이터가 변경되는 방식을 결정합니다.
열거형 |
OVERWRITE |
새 데이터는 쓰여지는 영역의 기존 데이터를 덮어씁니다. 참고: 시트 끝에 데이터를 추가해도 데이터를 쓸 수 있도록 새 행이나 열이 삽입됩니다. |
INSERT_ROWS |
새 데이터의 행이 삽입됩니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 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.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. |"]]