Get
Returns the properties of arrays or objects returned by either a Script, a Toolchain, another Get, or a GetProperty function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications..
The Get function requires minimum two arguments: a reference to a Script function or another Get function that returns an object or array, and either a string that denotes the property of an object, or a dot-separated path to a property of a sub-object. Optionally, you can specify a third argument to access a zero-based array index when an array is referenced.
In the following example, type this formula into the formula bar of the Spreadsheet:
If(A5, Get(A6,0), Get(A6,1))
The outcome can be the following:
-
If A5 is true and A6 is an array, Get returns the first element (0) in the array.
-
If A5 is false and A6 is an array, Get returns the second element (1) in the array.
-
If A6 is not an array, Get returns an error.
The Get function has the following syntax:
Get(Object, Property, [Array Index])
| Parameter | Description |
|
Script/Get |
Specifies a reference to a Script function or another Get function that returns an Object or Array data structure. |
|
Object Property and/or Array |
Specifies a reference to a property of an Object data structure, either as a string (the name of the property) or a dot-separated path to a property of a sub-object. Can also reference an Array data structure. |
|
[Array Index] |
Specifies an optional argument to an index of an array when an Array data structure is referenced. |
|
Returns |
The function returns the value of the property or indexed array element, and can return any of the following types:
Note: The function does not return the following from a Script function: null, undefined or no return statement, which is treated the same as an empty object.
|
The purpose of Get is similar to the purpose of the GetProperty function but they have the following differences in usage:
-
If both Get and GetProperty are options, consider using GetProperty. GetProperty has a property sheet that makes viewing the properties easier.
-
The Get function, however, is more useful when you need to dynamically generate a path or a portion of a path using cell references or subexpressions.
-
Get does not have a property sheet, which means you can use it within a formula.
-
GetProperty can access boths arrays and objects, but the path needs to be a constant string.
-
GetProperty uses forward slashes (/) for separating the paths that it generates.
-
Get can use dots (.) or forward slashes (/) for paths.