REST Resource: spreadsheets.values
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
משאב: ValueRange
נתונים בטווח מסוים בגיליון האלקטרוני.
ייצוג ב-JSON |
{
"range": string,
"majorDimension": enum (Dimension ),
"values": [
array
]
} |
שדות |
range |
string
הטווח שבו הערכים נכללים, בסימון A1. בפלט, הטווח הזה מציין את כל הטווח המבוקש, למרות שהערכים לא יכללו את השורות והעמודות האחרונות. כשמצרפים ערכים, השדה הזה מייצג את הטווח לחיפוש טבלה, שאחריה הערכים יתווספו.
|
majorDimension |
enum (Dimension )
המאפיין הראשי של הערכים. בתגובה להפעלה, אם נתוני הגיליון האלקטרוני הם: A1=1,B1=2,A2=3,B2=4 , הבקשה range=A1:B2,majorDimension=ROWS תחזיר את הערך [[1,2],[3,4]] , ואילו הבקשה range=A1:B2,majorDimension=COLUMNS תחזיר את הערך [[1,3],[2,4]] . בקלט, הערך range=A1:B2,majorDimension=ROWS ואז [[1,2],[3,4]] יגדירו את A1=1,B1=2,A2=3,B2=4 . עם range=A1:B2,majorDimension=COLUMNS , הפונקציה [[1,2],[3,4]] תגדיר את A1=1,B1=3,A2=2,B2=4 . כשכותבים, אם השדה הזה לא מוגדר, הערך שמוגדר בו כברירת מחדל הוא ROWS.
|
values[] |
array (ListValue format)
הנתונים שקראו או שרוצים לכתוב. זהו מערך של מערכי משנה, כאשר המערך החיצוני מייצג את כל הנתונים וכל מערך פנימי מייצג מאפיין ראשי. כל פריט במערך הפנימי תואם לתא אחד. בפלט, שורות ועמודות ריקות בסוף לא ייכללו. סוגי הערכים הנתמכים בקלט הם: bool, string ו-double. המערכת תדלג על ערכי Null. כדי להגדיר תא לערך ריק, מגדירים את ערך המחרוזת כמחרוזת ריקה.
|
Methods |
|
הוספת ערכים לגיליון אלקטרוני. |
|
מחיקת טווח אחד או יותר של ערכים מגיליון אלקטרוני. |
|
מחיקת טווח אחד או יותר של ערכים מגיליון אלקטרוני. |
|
הפונקציה מחזירה טווח אחד או יותר של ערכים מגיליון אלקטרוני. |
|
הפונקציה מחזירה טווח אחד או יותר של ערכים שתואמים למסנני הנתונים שצוינו. |
|
הגדרת ערכים בטווח אחד או יותר בגיליון אלקטרוני. |
|
הגדרת ערכים בטווח אחד או יותר בגיליון אלקטרוני. |
|
מחיקת ערכים מגיליון אלקטרוני. |
|
הפונקציה מחזירה טווח של ערכים מגיליון אלקטרוני. |
|
הגדרת ערכים בטווח של גיליון אלקטרוני. |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-03-22 (שעון UTC).
[null,null,["עדכון אחרון: 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. |"]]