REST Resource: spreadsheets.values
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zasób: ValueRange
dane z zakresu arkusza kalkulacyjnego;
Zapis JSON |
{
"range": string,
"majorDimension": enum (Dimension ),
"values": [
array
]
} |
Pola |
range |
string
Zakres, w którym występują wartości, w notacji A1. W przypadku danych zakres ten wskazuje cały żądany zakres, mimo że wartości będą wykluczać ostatnie wiersze i kolumny. Podczas dołączania wartości to pole reprezentuje zakres, w którym należy wyszukać tabelę, po której dołączane będą wartości.
|
majorDimension |
enum (Dimension )
Główny wymiar wartości. Jeśli dane arkusza kalkulacyjnego mają postać A1=1,B1=2,A2=3,B2=4 , to żądanie range=A1:B2,majorDimension=ROWS zwróci wartość [[1,2],[3,4]] , a żądanie range=A1:B2,majorDimension=COLUMNS – [[1,3],[2,4]] . W przypadku danych wejściowych, gdy range=A1:B2,majorDimension=ROWS jest równe [[1,2],[3,4]] , zostanie ustawiona wartość A1=1,B1=2,A2=3,B2=4 . Jeśli range=A1:B2,majorDimension=COLUMNS , to [[1,2],[3,4]] będzie ustawiać A1=1,B1=3,A2=2,B2=4 . Jeśli podczas zapisywania to pole nie jest ustawione, domyślnie przyjmuje wartość ROWS.
|
values[] |
array (ListValue format)
Dane, które zostały odczytane lub mają zostać zapisane. Jest to tablica tablic, przy czym tablica zewnętrzna reprezentuje wszystkie dane, a każda tablica wewnętrzna reprezentuje główny wymiar. Każdy element w tablicy wewnętrznej odpowiada jednej komórce. W danych wyjściowych nie będą uwzględniane puste końcowe wiersze i kolumny. W przypadku danych wejściowych obsługiwane są typy wartości: bool, string i double. Wartości null zostaną pominięte. Aby ustawić komórkę na pustą wartość, ustaw wartość ciągu na pusty ciąg znaków.
|
Metody |
|
Dodaje wartości do arkusza kalkulacyjnego. |
|
Czyści z arkusza kalkulacyjnego co najmniej 1 zakres wartości. |
|
Czyści z arkusza kalkulacyjnego co najmniej 1 zakres wartości. |
|
Zwraca co najmniej 1 zakres wartości z arkusza kalkulacyjnego. |
|
Zwraca co najmniej 1 zakres wartości pasujących do określonych filtrów danych. |
|
Ustawia wartości w co najmniej 1 zakresie arkusza kalkulacyjnego. |
|
Ustawia wartości w co najmniej 1 zakresie arkusza kalkulacyjnego. |
|
Czyści wartości z arkusza kalkulacyjnego. |
|
Zwraca zakres wartości z arkusza kalkulacyjnego. |
|
Ustawia wartości w zakresie arkusza kalkulacyjnego. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-03-22 UTC.
[null,null,["Ostatnia aktualizacja: 2025-03-22 UTC."],[],[],null,["# REST Resource: spreadsheets.values\n\n- [Resource: ValueRange](#ValueRange)\n - [JSON representation](#ValueRange.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: ValueRange\n--------------------\n\nData within a range of the spreadsheet.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"range\": string, \"majorDimension\": enum (/workspace/sheets/api/reference/rest/v4/Dimension), \"values\": [ array ] } ``` |\n\n| Fields ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `range` | `string` The range the values cover, in [A1 notation](https://developers.google.com/workspace/sheets/api/guides/concepts#cell). For output, this range indicates the entire requested range, even though the values will exclude trailing rows and columns. When appending values, this field represents the range to search for a table, after which values will be appended. |\n| `majorDimension` | `enum (`[Dimension](/workspace/sheets/api/reference/rest/v4/Dimension)`)` The major dimension of the values. For output, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=A1:B2,majorDimension=ROWS` will return `[[1,2],[3,4]]`, whereas requesting `range=A1:B2,majorDimension=COLUMNS` will return `[[1,3],[2,4]]`. For input, with `range=A1:B2,majorDimension=ROWS` then `[[1,2],[3,4]]` will set `A1=1,B1=2,A2=3,B2=4`. With `range=A1:B2,majorDimension=COLUMNS` then `[[1,2],[3,4]]` will set `A1=1,B1=3,A2=2,B2=4`. When writing, if this field is not set, it defaults to ROWS. |\n| `values[]` | `array (`[ListValue](https://protobuf.dev/reference/protobuf/google.protobuf/#list-value)` format)` The data that was read or to be written. This is an array of arrays, the outer array representing all the data and each inner array representing a major dimension. Each item in the inner array corresponds with one cell. For output, empty trailing rows and columns will not be included. For input, supported value types are: bool, string, and double. Null values will be skipped. To set a cell to an empty value, set the string value to an empty string. |\n\n| Methods ------- ||\n|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|\n| ### [append](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/append) | Appends values to a spreadsheet. |\n| ### [batchClear](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchClear) | Clears one or more ranges of values from a spreadsheet. |\n| ### [batchClearByDataFilter](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchClearByDataFilter) | Clears one or more ranges of values from a spreadsheet. |\n| ### [batchGet](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchGet) | Returns one or more ranges of values from a spreadsheet. |\n| ### [batchGetByDataFilter](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchGetByDataFilter) | Returns one or more ranges of values that match the specified data filters. |\n| ### [batchUpdate](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchUpdate) | Sets values in one or more ranges of a spreadsheet. |\n| ### [batchUpdateByDataFilter](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchUpdateByDataFilter) | Sets values in one or more ranges of a spreadsheet. |\n| ### [clear](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/clear) | Clears values from a spreadsheet. |\n| ### [get](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/get) | Returns a range of values from a spreadsheet. |\n| ### [update](/workspace/sheets/api/reference/rest/v4/spreadsheets.values/update) | Sets values in a range of a spreadsheet. |"]]