Google Sheets
Actions for handling Google Sheets data
Last updated
Actions for handling Google Sheets data
Last updated
To use this actions you need to configure Google Cloude. See more:
Base Google Sheets action. Subclass of Action.
client (GoogleCloudClient): Google client that will be used for access.
name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.
Create spreadsheet. Subclass of GoogleSheetsAction. Type of GoogleSheetsAction[Dict[str, Any], Dict[str, Any]].
input_data (Dict[str, Any]): Expected keys:
"title" (str): Name of the spreadsheet;
"sheets" (List[str], optional): Sheets names to create. Defaults to ["Sheet1"].
Exception: If unable to create spreadsheet.
Dict[str, Any]: Expected keys:
"spreadsheet_id" (str): Spreadsheet ID;
Read spreadsheet. Subclass of GoogleSheetsAction. Type of GoogleSheetsAction[Dict[str, Any], Dict[str, Any]].
input_data (Dict[str, Any]): Expected keys:
"spreadsheet_id" (str): Spreadsheet ID (can be found in url: https://docs.google.com/spreadsheets/d/spreadsheet_id/edit#gid=0);
"cells_range" (str): Range of cells provided in A1 notation. Examples: "B2:C2", "A1", "Sheet1", "Sheet1!A1:B1", etc..
Exception: If unable to read spreadsheet.
Dict[str, Any]: Expected keys:
"table" (List[List[Any]]): Table that represents sheet or part of it specified by "cells_range";
Read spreadsheet batch. Subclass of GoogleSheetsAction. Type of GoogleSheetsAction[Dict[str, Any], List[Dict[str, Any]]].
input_data (Dict[str, Any]): Expected keys:
"spreadsheet_id" (str): Spreadsheet ID (can be found in url: https://docs.google.com/spreadsheets/d/spreadsheet_id/edit#gid=0);
"cells_ranges" (List[str]): Ranges of cells provided in A1 notation. Examples: "B2:C2", "A1", "Sheet1", "Sheet1!A1:B1", etc..
Exception: If unable to read spreadsheet.
List[Dict[str, Any]]: List of items containing tables. Items expected keys:
"table" (List[List[Any]]): Table that represents sheet or part of it specified by "cells_range";
Write to spreadsheet. Subclass of GoogleSheetsAction. Type of GoogleSheetsAction[Dict[str, Any], Dict[str, Any]].
input_data (Dict[str, Any]): Expected keys:
"spreadsheet_id" (str): Spreadsheet ID (can be found in url: https://docs.google.com/spreadsheets/d/spreadsheet_id/edit#gid=0);
"cells_range" (str): Range of cells provided in A1 notation. Examples: "B2:C2", "A1", "Sheet1", "Sheet1!A1:B1", etc..
"value_input_option" (InputOption, optional): Input option can be: InputOption.USER_ENTERED - All inputs treated as input from the user (enabling formatting and formulas), or InputOption.RAW - all inputs as is. Defaults to InputOption.USER_ENTERED.
"table" (List[List[Any]]): Values to add to spreadsheet.
Exception: If unable to update spreadsheet.
Dict[str, Any]: Expected keys:
"spreadsheet" (Dict[str, Any]): Updated spreadsheet;
Write to spreadsheet batch. Subclass of GoogleSheetsAction. Type of GoogleSheetsAction[Dict[str, Any], Dict[str, Any]].
input_data (Dict[str, Any]): Expected keys:
"spreadsheet_id" (str): Spreadsheet ID (can be found in url: https://docs.google.com/spreadsheets/d/spreadsheet_id/edit#gid=0);
"value_input_option" (InputOption, optional): Input option can be: InputOption.USER_ENTERED - All inputs treated as input from the user (enabling formatting and formulas), or InputOption.RAW - all inputs as is. Defaults to InputOption.USER_ENTERED.
"inputs" (List[Dict[str, Any]]): List of write actions. Each action contain:
"cells_range" (str): Range of cells provided in A1 notation. Examples: "B2:C2", "A1", "Sheet1", "Sheet1!A1:B1", etc..
"table" (List[List[Any]]): Values to add to spreadsheet.
Exception: If unable to update spreadsheet.
Dict[str, Any]: Expected keys:
"spreadsheet" (Dict[str, Any]): Updated spreadsheet;
Write to spreadsheet. Subclass of GoogleSheetsAction. Type of GoogleSheetsAction[Dict[str, Any], Dict[str, Any]].
input_data (Dict[str, Any]): Expected keys:
"spreadsheet_id" (str): Spreadsheet ID (can be found in url: https://docs.google.com/spreadsheets/d/spreadsheet_id/edit#gid=0);
"cells_range" (str): Range of cells provided in A1 notation. Examples: "B2:C2", "A1", "Sheet1", "Sheet1!A1:B1", etc..
"value_input_option" (InputOption, optional): Input option can be: InputOption.USER_ENTERED - All inputs treated as input from the user (enabling formatting and formulas), or InputOption.RAW - all inputs as is. Defaults to InputOption.USER_ENTERED.
"insert_data_option" (InsertDataOption, optional): Isert data option can be InsertDataOption.OVERWRITE - will overwrite anything after table, or InsertDataOption.INSERT_ROWS - will insert new rows. Defaults to InsertDataOption.OVERWRITE.
"table" (List[List[Any]]): Values to add to spreadsheet.
Exception: If unable to update spreadsheet.
Dict[str, Any]: Expected keys:
"spreadsheet" (Dict[str, Any]): Updated spreadsheet;
Google Sheets default configuration. Subclass of GoogleCloudClientConfig.
scopes (List[str]): Access scopes. Defaults to ["https://www.googleapis.com/auth/spreadsheets"] (Read and write acess to all spreadsheets).
service (str): Service name. Defaults to "sheets" (Google Spreadsheets service).
version (str): API version. Defaults to "v4".
Specify major dimension(i.e. what outer list represents)
Specify how input data should be formatted
Inputs as is
All inputs treated as input from the user (enabling formatting and formulas)
How data should be append to table
Insert new rows
Overwrite anything after table