Skip to main content

googlesheets@5.0.0

appendValues(spreadsheetId, range, values, [options])
batchUpdateValues(spreadsheetId, data, [options])
getValues(spreadsheetId, range)

This adaptor exports the following from common:

alterState
combine()
cursor()
dataPath()
dataValue()
each()
field()
fields()
fn()
fnIf()
lastReferenceValue()
log()
merge()
sourceValue()

Functions

appendValues

appendValues(spreadsheetId, range, values, [options]) ⇒ Operation

Append one or more rows to a spreadsheet range. https://developers.google.com/sheets/api/samples/writing#append_values

ParamTypeDescription
spreadsheetIdstringThe spreadsheet ID.
rangestringThe sheet range.
valuesarrayThe values to append.
[options]ObjectOptional settings.
[options.valueInputOption]stringDefaults to 'USER_ENTERED'.

Example

appendValues(
'1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
'Sheet1!A1:E1',
[['From expression', '$15', '2', '3/15/2016'], ['Really now!', '$100', '1', '3/20/2016']]
)

batchUpdateValues

batchUpdateValues(spreadsheetId, data, [options]) ⇒ Operation

Batch update values in a Spreadsheet.

Returns: Operation - spreadsheet information

ParamTypeDescription
spreadsheetIdstringThe spreadsheet ID.
dataArray.<{range: string, values: array}>Array of range/values objects to update.
[options]ObjectOptional settings.
[options.valueInputOption]stringDefaults to 'USER_ENTERED'.

Example: Update multiple separate ranges

batchUpdateValues(
'1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
[
{ range: 'Sheet1!A1', values: [['value1']] },
{ range: 'Sheet1!B5', values: [['value2']] },
{ range: 'Sheet1!D10:E11', values: [['a', 'b'], ['c', 'd']] },
],
{ valueInputOption: 'RAW' }
)

getValues

getValues(spreadsheetId, range) ⇒ Operation

Gets cell values from a Spreadsheet.

Returns: Operation - spreadsheet information

ParamTypeDescription
spreadsheetIdstringThe spreadsheet ID.
rangestringThe sheet range.

Example

getValues('1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos','Sheet1!A1:E1')