auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
return [
["Luke", 1],
["Leia", 2],
["Han", 3],
]
auths
objectThe ID of the target spreadsheet, found at the end of the URL: https://docs.google.com/spreadsheets/d/{id}
The sheet you'd like to add a row to
return
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, params, auths) => {
}
const returnData = []
for (const row of steps.nodejs.$return_value) {
const data = {
values: [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,
}
returnData.push(await require("@pipedreamhq/platform").axios(this, config))
}