Create a Google Sheet from JSON array
This is a 'Workflow' template which means that it is a single standalone workflow.
Some workflow templates can be modified to work with other workflow templates - e.g. to convert a data sync between two services from uni-directional to bi-directional
Tray.io Community Collaboration
We built this template in collaboration with Zeyuan Zhao (Level 4 Artisan builder and member of the Tray.io Slack community)
How to use this templateCopy
The first thing you'll want to do when you load the template into your workspace is add authentications for the Google Sheet connectors and Google Drive connector.
We suggest testing the workflow with a basic array of data first, so create a manually triggered workflow and grab a list of test data using either an existing connector you’ve previously used to grab arrays/lists of data or you can use the “List Customers” operation from our CRM Trayning connector.
Once you’ve identified a list of data you would like to add to a Google Sheet, you can begin setting up the connector to this callable workflow by adding a callable workflow connector to your builder canvas with the “fire and wait for response” operation set and the workflow selected:
Next, you’ll choose the “operation” of the callable:
If you choose to "create a new sheet", then provide a name for the spreadsheet:
If you wish to edit an existing sheet, specify the URL of the sheet (make sure the sheet is shared such that the auth you are using can edit the sheet):
The “sheet name” is used to name the specific sheet you’ll create or update in the spreadsheet:
The “sheet action” is used for cases where you are updating an existing sheet:
Replacing all data wipes any existing data in the sheet out and adding data to the sheet appends the data to the end of the active rows.
Next, you’ll map the array of data you wish to send to the sheet:
You can send the workflow three types of arrays:
Array of objects - If you’re creating new sheet or replacing data in an existing sheet, the workflow will transform the object’s properties into the column headers of the sheet. If you’re adding data to an existing sheet, no headers will be created.
Array of non-objects or non-arrays (e.g., integers, strings, etc) - This would result in a single column of data in the sheet.
Array of arrays - Each child array will act as a row and each item in the child array will act as a cell value in the row, where the first item is the left most cell and last item the right most cell.
Finally, you can optionally specify a list of emails you wish to share the sheet with. This might be helpful if you want them to get a sharing notice from drive or just have it accessible to them when you send them a link.
The response of the workflow includes the following data: