auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
return {
google_sheet_id: "1y7sW4Qv9xHIA9tOXhgOtIB6yN1LegSMmf0GrlbHsSRk"
}
The ID of the spreadsheet to insert rows into. The spreadsheetID can be found in the URL when viewing your Google sheet. E.g., https://docs.google.com/spreadsheets/d/[spreadsheetId]/edit#gid=0
The A1 notation of the values to retrieve. E.g., A1:E5 or Sheet1!A1:E5
async
(params, auths) => {
}
const {google} = require('googleapis')
const auth = new google.auth.OAuth2()
auth.setCredentials({ access_token: auths.google_sheets.oauth_access_token })
const sheets = await google.sheets({version: 'v4', auth});
const response = await sheets.spreadsheets.values.get({
spreadsheetId: params.spreadhsheetId,
range: params.range
})
this.status = response.status
this.statusText = response.statusText
return response.data
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
// loop over all cells, if any, and filter to those before now
let earliest = new Date(3000,1,1);
let now = new Date();
let selected = -1;
let cells = steps.get_values.$return_value.values;
if(!cells) $end('No content from sheet.');
cells.forEach((v,i) => {
let thisDate = new Date(v[1]);
if(thisDate < now && thisDate < earliest) {
earliest = thisDate;
selected = i;
console.log('set selected to '+i)
}
});
if(selected >= 0) {
// why the plus one? we start reading at the second row
return {
index: selected+1,
indexPlusOne: selected+2,
text: cells[selected][0]
};
} else $end('No values to select.');
async
(params, auths) => {
}
const axios = require('axios')
const {status, in_reply_to_status_id, auto_populate_reply_metadata, exclude_reply_user_ids, attachment_url, media_ids, possibly_sensitive, lat, long, place_id, display_coordinates, trim_user, enable_dmcommands, fail_dmcommands, card_uri} = params
const body = {
config: {
url: `https://api.twitter.com/1.1/statuses/update.json`,
method: 'POST',
params,
},
token: {
key: auths.twitter.oauth_access_token,
secret: auths.twitter.oauth_refresh_token,
},
}
const proxy = "https://api.pipedream.com/v1/oauth1/app_13GhY1"
const resp = await axios.post(proxy,body)
const {messages, data} = resp.data
for (const message of messages) {
console.log(message)
}
return data
The ID of the sheet you'd like to add a row to, retrieved using the Get Spreadsheet Action
Are you deleting ROWS or COLUMNS?
The 0-based index of the row or column you'd like to start deleting from, inclusive. For example, row 1 has an index of 0, row 2 has an index of 1. Column A has an index of 0, column B has an index of 1.
The 0-based index of the row or column where you'd like to stop your deletion. Unlike the Start Index, this parameter is exclusive. For example, to delete Row 1 of your spreadsheet, pass a Start Index of 0 and an End Index of 1.
The ID of your spreadsheet. For example, the 1bn9xlC8asUl3OR12LOuJ7Z_4F6nzIOYdTDm1Ec1HCHw in the URL https://docs.google.com/spreadsheets/d/1bn9xlC8asUl3OR12LOuJ7Z_4F6nzIOYdTDm1Ec1HCHw/edit
async
(params, auths) => {
}
const data = {
requests: [
{
"deleteDimension": {
"range": {
"sheetId": params.sheetId,
"dimension": params.dimension,
"startIndex": params.startIndex,
"endIndex": params.endIndex,
}
}
}
],
includeSpreadsheetInResponse: params.includeSpreadsheetInResponse,
}
const config = {
method: "post",
url: `https://sheets.googleapis.com/v4/spreadsheets/${params.spreadsheetId}:batchUpdate`,
headers: {
Authorization: `Bearer ${auths.google_sheets.oauth_access_token}`,
},
data,
}
return await require("@pipedreamhq/platform").axios(this, config)