Google Sheets Example - reference HTTP payload directly
@dylan
code:
data:privatelast updated:4 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
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
add_new_row_to_sheet
Add a row to a sheet using the append API: https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append
auth
(auths.google_sheets)
params
Row

The array of data representing the cells of the row, for example [1, 2, 3]

[0]:
{{event.body.name}}
[1]:
{{event.body.title}}
array ·params.row
Spreadsheet ID

The ID of the target spreadsheet, found at the end of the URL: https://docs.google.com/spreadsheets/d/{id}

11Gl7ay0HHGdZyGwRYFI_jLtIt_WORuR7fqmqDzh7YQo
string ·params.spreadsheetId
Sheet Name

The sheet you'd like to add a row to

Sheet1
string ·params.sheetName
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
}
18
const data = {
  values: [params.row],
}
const config = {
  method: "post",
  url: `https://sheets.googleapis.com/v4/spreadsheets/${params.spreadsheetId}/values/${params.sheetName}:append`,
  params: {
    includeValuesInResponse: true,
    valueInputOption: "USER_ENTERED"
  },
  headers: {
    Authorization: `Bearer ${auths.google_sheets.oauth_access_token}`,
  },
  data,
}
return await require("@pipedreamhq/platform").axios(this, config)