Event Target for Google Sheets
This event Target receives CloudEvents over HTTP and appends the event payload to a GoogleSheets Sheet.
- Google API credentials
- GoogleSheets Sheet ID
Google API Credentials
- Head to the Google Developers Console and create a new project (or select the one you have).
- Under APIs & Services > Library, search for “Sheets API” and enable it.
- Go to APIs & Services > Credentials and choose “Create credentials > Service account”. Enter a service account name, ID, and description. You can skip optional fields, no additional roles or user access is required.
- On the last step of service account creation, download the JSON key file.
- Use the email from the
client_emailfield within the JSON key file to share the GoogleSheets Sheet you want the Target to have access to. The Notify people checkbox should be unchecked.
Consult the Secrets guide for more information about how to add the Google API key as a secret.
GoogleSheets Sheet ID
In your browser, navigate to the GoogleSheets Sheet you want to use. You can find the Sheet ID in one of two ways:
- From path:
- From query string:
Deploying an Instance of the Target
Open the Bridge creation screen and add a Target of type
In the Target creation form, provide a name for the event Target and add the following information:
- Google Service Account Secret: Reference to a TriggerMesh secret containing a Google API key as discussed in Google API Credentials.
- ID: The GoogleSheets Sheet ID to send the event payload to.
- Default Prefix: A string used during new sheet creation when the event does not provide one.
After clicking the
Save button, the console will self-navigate to the Bridge editor. Proceed by adding the remaining components to the Bridge.
After submitting the Bridge, and allowing for some configuration time, a green check mark on the main Bridges page indicates that the Bridge with a GoogleSheets event Target was successfully created.
The GoogleSheets Target will accept any event type, and by default, will stringify the CloudEvent and save the data in a new row.
Events of this type contain nuanced data that is used to append the event data to a new row.
This type expects a JSON payload with the following properties:
|sheet_name_prefix||string||The prefix to be used for creating new sheets|
|message||string||A string to append to the sheet row|