# Get

Returns the properties of arrays or objects returned by either a Script, a Toolchain Contains a group of tools and the sequence of execution for each tool., another Get, or a GetProperty function.

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.

Example

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:

1. If A5 is true and A6 is an array, Get returns the first element (0) in the array.

2. If A5 is false and A6 is an array, Get returns the second element (1) in the array.

3. If A6 is not an array, Get returns an error.

Inputs

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.

Outputs

Returns | The function returns the value of the property or indexed array element, and can return any of the following types: Numeric value Boolean String Binary data structure Blob, Edge, Histogram, or Patterns data structure Shape object Object Image Null, undefined or no return statement, which is treated the same as an empty object. 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.

Differences Between Get and GetProperty

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.