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 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”. (No extra roles nor users access is required, you can skip optional fields)
- On the last step of service account creation download the JSON key.
client_email field within the credentials JSON file you downloaded to share the
Google Spreadsheets you want the Target to have access to. (when sharing Notifications mark should be disabled)
Create a new Google Sheet and share it with the 'client_email' address found in the JSON key. (when sharing the "Send Notifications" mark should be disabled)
Navigate to the sheet that is to be used or was just created:
- 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 to the event Target, and add the following information:
- Google Service Account Secret: Reference to a TriggerMesh secret containing a Google API key as described in the previous section.
- ID: The GoogleSheets Sheet ID to send the event payload.
- 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 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|