getValue

returns the value(s) of a cell(s)

string|number|array getValue(string cells);

Parameters

cellsstringthe id(s) of a cell(s) or a range of cells

Returns

string|number|arraythe values of cells

Example

// returning the value of one cell
var cellValue = spreadsheet.getValue("A2"); // "Ecuador"
 
// returning the values of the range of cells
var rangeValues = spreadsheet.getValue("A1:A3"); // -> ["Country","Ecuador","Belarus"]
 
// returning the values of different cells
var values = spreadsheet.getValue("A1,B1,C1:C3");
//-> ["Country", "Product", "Price", 6.68, 3.75]

See also
Back to top