Google Drive
Create spreadsheet
warning Self-Service Plan users (including trial version users) must enable the Google Sheets API. If you intend to use the sharing feature (Grantee type property), you must also enable the Google Drive API. For more information on enabling the Google Sheets and Google Drive APIs, please refer to Enabling Google APIs.
Overview
This BLOCK creates a Google Sheets spreadsheet in Google Drive.
If successful, it outputs a URL for the new spreadsheet as a log. This URL can be used to access the spreadsheet.
info_outline Permission is required to access the spreadsheet. You can give access permission by configuring sharing settings within the advanced properties of this BLOCK, or by connecting a Share items from Google Drive BLOCK.
You must set a variable as the contents for the new spreadsheet. The data stored in the variable should be an array of objects.
Refer to the following chart and explanations for more information about this data type (first row is the header row):
Column Title 1 | Column Title 2 | Column Title 3 |
---|---|---|
"foo" | 123 | 1.3 |
"bar" | 456 | 4.6 |
"baz" | 789 | 7.9 |
- Express the data as an array that contains each row of data as an object.
- Each object consists of a key and value pair to express each column of data.
- Set each key as the header for each column.
- Set the value as the data in each column.
Below are examples of expressing the data using JSON and the Construct object BLOCK:
- JSON:
[ {"Column Title 1": "foo", "Column Title 2": 123, "Column Title 3": 1.3}, {"Column Title 1": "bar", "Column Title 2": 456, "Column Title 3": 4.6}, {"Column Title 1": "baz", "Column Title 2": 789, "Column Title 3": 7.9} ]
- Construct object BLOCK:
Properties
Property | Explanation |
---|---|
BLOCK name | Configure the name displayed on this BLOCK. |
GCP service account | Select the GCP service account to use with this BLOCK. |
File name |
Designate the file name for the new spreadsheet. If left blank, a name will be automatically assigned. Supports variable expansion.
|
Input variable |
Designate the variable that contains the data to write to the new spreadsheet. |
BLOCK memos | Make notes about this BLOCK. |
Worksheet name |
Designate the name of the worksheet within the new spreadsheet. A worksheet name will be automatically assigned if you leave this field blank. Supports variable expansion.
|
Starting cell (A1 notation) | Designate the starting cell (A1 notation) for writing to the worksheet. |
Output header line |
Select whether or not to output the header line.
|
Output keys |
Designate specific keys for the data contained in the Input variable. Only data for the specified keys will be output to create the new spreadsheet. The spreadsheet columns will be ordered in the same order as the keys you designate in this property. Click + to add keys. |
Grantee type |
Select who to share the spreadsheet with.
|
Role granted |
Select the role to give to those you share the spreadsheet with.
|
Email address |
When Grantee type is set to Specific users or Group, designate the email address of those you want to share the spreadsheet with. You can enter multiple emails at once as a comma-separated list (
Supports variable expansion.
|
Domain | When Grantee type is set to Domain, designate a Google Workspace domain. Supports variable expansion.
|
Allow file discovery |
When Grantee type is set to Domain or Anyone on the web, designate whether or not to have the spreadsheet appear in search results.
|