0.0.3 • Published 1 year ago

wbb-spreadsheet-integration v0.0.3

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

WBB Spreadsheet Integration

This project allows you to easily integrate with Google Spreadsheet to fetch and store information in a google sheet.

Setup

To use this integration you will need a GCP Service Account. This allows the service account to read and write to spreedsheats. You will also need to have Google Sheets API enabled.

Blocks Provided

This integration provides the following blocks under the topic of Google-Spreadsheet.

  • Save to Google Sheets - Pre-defined function block to start using save-data handler
  • Fetch from Google Sheets - Pre-defined function block to start using get-data handler
  • No Credentials set - when the required settings have not been provided.
  • No Spreadsheet ID Set - when the required settings have not been provided.
  • No Key Column Name Set - when the required settings have not been provided.
  • No Value Property Name Set - when the required settings have not been provided.
  • No Return String Set - when the required settings have not been provided.

Handler Names

The following handler names and their functions are available :

Handler NamePurpose
save-dataIt will save data to a spreadsheet from any form attached with this function block
get-dataReturn form values from a spreadsheet based on a give parameter

Configuration Options

Within the function there are a number of options that can be set to configure the behaviour of the integration. The tables below show the settings that are available for each handler.

save-data

PropertyRequiredDescription
credentials.clientEmailtrueThe client_email property copied from JSON Service Account credentials for an account that has access to google spreadsheet.
credentials.privateKeytrueThe private_key property copied from JSON Service Account credentials for an account that has access to google spreadsheet.
spreadsheetIDtrueA spreadsheetID is the long id in the sheets URL.
confirmationBlocktrueThe block to send the user to after completing the form.
saveUserIdfalseSet param to true if you want to save user _id alongside other data.

get-data

PropertyRequiredDescription
credentials.clientEmailtrueThe client_email property copied from JSON Service Account credentials for an account that has access to google spreadsheet.
credentials.privateKeytrueThe private_key property copied from JSON Service Account credentials for an account that has access to google spreadsheet.
spreadsheetIDtrueA spreadsheetID is the long id in the sheets URL.
sheetIndexfalseThe index of the tab to fetch data from. Index starts at zero.
keyColumnNametrueColumn name from the spreadsheet that form value will be matched against
valuePropertyNametrueForm question title name which value will be used to match the requested row
returnStringtrueText user will be sent after the right row is matched with other form values, e.g. Your order number, %%orderNumber%% will be delivered on %%expectedDeliveryDate%%.
notFoundDataBlocktrueThe block to send the user if no data is found.