get count filled rows and expose values google sheets (public)
@kevded
code:
data:privatelast updated:3 years agoarchived
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_get_totals_responses_and_fields_typeform_updated
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
get_values_from_sheet
Returns the values of all cells of the specified sheet, for the specified spreadsheet ID.
auth
(auths.google_sheets)
params
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
Sheet Name

Specify a sheet within your spreadsheet, like "Sheet1", or a range of values, like "Sheet1!A1:B2"

 
string ·params.sheet_name
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
}
17
// See https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get
// for details on the API docs.
const config = {
  url: `https://sheets.googleapis.com/v4/spreadsheets/${params.spreadsheetId}/values/${params.sheet_name}`,
  params: {
    dateTimeRenderOption: params.dateTimeRenderOption,
    majorDimension: params.majorDimension,
    valueRenderOption: params.valueRenderOption,
  },
  headers: {
    Authorization: `Bearer ${auths.google_sheets.oauth_access_token}`,
  },
}
return await require("@pipedreamhq/platform").axios(this, config)
steps.
respond
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
}
10
return await $respond({
  immediate: true,
  status: 200,
  body: {
    rows: steps.get_values_from_sheet.$return_value.values.length,
  values: steps.get_values_from_sheet.$return_value.values
  }
})