Update Google Spreadsheets cell example
@dylburger
code:
data:privatelast updated:2 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 800,000+ developers using the Pipedream platform
steps.
trigger
active
last updated:-last event:-
steps.
update_spreadsheet_values
Updates the values of the cells of the specified range, for the specified spreadsheet ID.
auth
(auths.google_sheets)
params
Range

The A1 notation of the values to update, including the sheet to update. For example: “Sheet1!A1:B2”

Sheet1!A1:A1
string ·params.range
Values

The array of new values to update the sheet with. Google Sheets requires an array of arrays here, representing the grid of values you'd like to update in your sheet (see the docs for more information).

{{ [[ "Test" ]] }}
array ·params.values
Spreadsheet ID

The ID of the spreadsheet to retrieve data from (found in the URL at docs.google.com/spreadsheets/d/{id})

 
string ·params.spreadsheetId
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
}
23
const data = {
  range: params.range,
  values: params.values,
  majorDimension: params.majorDimension,
}
const config = {
  method: "put",
  url: `https://sheets.googleapis.com/v4/spreadsheets/${params.spreadsheetId}/values/${params.range}`,
  params: {
    includeValuesInResponse: params.includeValuesInResponse,
    responseDateTimeRenderOption: params.responseDateTimeRenderOption,
    responseValueRenderOption: params.responseValueRenderOption,
    valueInputOption: params.valueInputOption || 'USER_ENTERED',
  },
  headers: {
    Authorization: `Bearer ${auths.google_sheets.oauth_access_token}`,
  },
  data,
}
return await require("@pipedreamhq/platform").axios(this, config)