Home / All Integrations / Google Sheets

free

Connect Google Sheets to your chatbot

Manage data in Google Sheets


Save and access data in a Google Sheets table.

Authentication

To authenticate this App, please refer to this documentation: https://cloud.google.com/docs/authentication/production and create a Service Account to interact with Google Sheets.
You can also refer to this documentation for a step-by-step walkthrough on how to retrieve the right credentials.

You will also need a spreadsheet_id that you can pass as an argument to the Fn call or as an optional environment variable.
The spreadsheet ID can be found in the URL of your spreadsheet: for example,
in https://docs.google.com/spreadsheets/d/1R_uHoL3PmS3pAa5ujG2aARbw9REIjORXiZDGigQoLoA/edit#gid=0, the spreadsheet ID is
1R_uHoL3PmS3pAa5ujG2aARbw9REIjORXiZDGigQoLoA.

Methods

  • App("google/sheets", method="setHeaderRow", values=["firstname", "lastname"]): set the header row for the table
  • App("google/sheets", method="addRow", row={"firstname": "John", "lastname": "Smith"}): add a row in the sheet
  • App("google/sheets", method="addRows", rows=[{"firstname": "John", "lastname": "Smith"}, {"firstname": "Jane", "lastname": "Doe"}]): add multiple rows at once
  • App("google/sheets", method="getRows", offset=0, limit=100): retrieve the next limit rows starting with the row at index offset. Defaults to offset=0, limit=100. The max value of limit is 100.
  • App("google/sheets", method="clear"): remove all the data in this sheet.

Optional properties:

  • spreadsheet_id: Must be set either in each function call or in the environment variables. If it is set in both places, the one in the function call will be used.
  • sheet_index: If you are using a sheet other than the first spreadsheet tab, please pass its index (starting at 0). Defaults to 0.

Usage

App("google/sheets", method="addRow", row={"firstname": "John", "lastname": "Smith"}, spreadsheet_id="ABC123456", sheet_index=2)

Join the Community
on Slack Slack

Come and learn all about CSML with other chatbot enthusiasts on the CSML Community Slack! 🤗