SAP Help Home SAP Intelligent RPA Help Portal SAP Intelligent RPA Community

Module - Google Sheets

Activities for interacting with Google Sheets.

Activities

Create Spreadsheet (Google Sheet)

Create a spreadsheet in Google Sheets.


Technical Name Type Minimal Agent Version
createSpreadsheet asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
title string optional The title of the spreadsheet that will be created.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
spreadSheetDetails irpa_googleworkspace.spreadSheetDetails Parameter returning the details of the newly created spreadsheet, like its ID, name, and URL for example.

Errors:

Error Class Package Description
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Add Sheet (Google Sheet)

Add a sheet to a Google spreadsheet.


Technical Name Type Minimal Agent Version
addSheet asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
spreadsheetId string mandatory ID of the spreadsheet in which you want to add a sheet.
sheetTitle string optional Title of the new sheet that will be added.
index number optional Index of the new sheet that will be added.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
sheetDetails irpa_googleworkspace.Sheet Parameter returning the details of the newly created sheet, like its ID, name and URL for example.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Delete Sheet (Google Sheet)

Delete a sheet from a Google spreadsheet.


Technical Name Type Minimal Agent Version
deleteSheet asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
spreadsheetId string mandatory ID of the spreadsheet in which you want to delete a sheet.
sheetId number mandatory ID of the sheet that will be deleted.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
result boolean Returns 'true' if the sheet was successfully deleted, otherwise returns an error message.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Rename Sheet (Google Sheet)

Rename an existing sheet inside a Google spreadsheet.


Technical Name Type Minimal Agent Version
renameSheet asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
spreadsheetId string mandatory ID of the spreadsheet in which you want to rename a sheet.
sheetId number mandatory ID of the sheet that will be renamed.
newTitle string mandatory New name of the sheet that will be renamed.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
result boolean Returns 'true' if the sheet was successfully renamed, otherwise returns an error message.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Rename Spreadsheet (Google Sheet)

Rename an existing Google spreadsheet.


Technical Name Type Minimal Agent Version
renameSpreadsheet asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
spreadsheetId string mandatory ID of the spreadsheet that will be renamed.
newTitle string mandatory New name of the spreadsheet that will be renamed.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
result boolean Returns 'true' if the spreadsheet was successfully renamed, otherwise returns an error message.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Hide Sheet (Google Sheet)

Hide or un-hide an existing sheet inside a Google spreadsheet.


Technical Name Type Minimal Agent Version
hideSheet asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
spreadsheetId string mandatory ID of the spreadsheet in which you want to hide a sheet.
sheetId number mandatory ID of the sheet that will be hidden.
hidden boolean mandatory Select true or false whether you want to hide or un-hide a sheet.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
result boolean Returns 'true' if the spreadsheet was successfully hidden or unhidden, otherwise returns an error message.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Copy Sheet (Google Sheet)

Copy an existing sheet from a Google Spreadsheet to another or a new Google spreadsheet.


Technical Name Type Minimal Agent Version
copySheet asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
sourceSpreadsheetId string mandatory ID of the spreadsheet from which the sheet will be copied.
sheetId number mandatory ID of the sheet that will be copied.
destinationSpreadsheetId string optional ID of the spreadsheet in which you want to copy a sheet. If you don't set this parameter, a new spreadsheet is created.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
spreadSheetDetails irpa_googleworkspace.spreadSheetDetails Returns 'true' if the sheet was successfully copied, otherwise returns an error message.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Move Sheet (Google Sheet)

Move an existing sheet inside a Google spreadsheet.


Technical Name Type Minimal Agent Version
moveSheet asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
spreadsheetId string mandatory ID of the spreadsheet in which you want to move a sheet.
sheetId number mandatory ID of the sheet that will be moved.
moveDirection irpa_googleworkspace.enums.GoogleSheetsMoveSheetParams mandatory Select 'moveRight or 'moveLeft depending on the position you want to move the sheet.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
result boolean Returns 'true' if the sheet was successfully moved, otherwise returns an error message.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Get Spreadsheet Details (Google Sheet)

Retrieve the details of a Google spreadsheet, including the list of the sheets contained in the spreadsheet.


Technical Name Type Minimal Agent Version
getSpreadSheetDetails asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
spreadSheetId string mandatory ID of the spreadsheet for which you want to get the details.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
spreadSheetDetails irpa_googleworkspace.spreadSheetDetails Parameter returning the details of the spreadsheet, like its ID, name and URL for example.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Get List of Spreadsheets (Google Sheet)

Retrieve a list of spreadsheets based on a specified query.


Technical Name Type Minimal Agent Version
listSpreadSheets asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
driveId string optional The ID of the Google Drive from which you want to retrieve a list of spreadsheets. If you don'€™t set this parameter, 'My Drive' files is fetched.
query string optional Search query to retrieve the list of spreadsheets. This query is like the other search queries in Google Drive.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
metaDatas Array.<irpa_googleworkspace.googleDriveContentMetadata> Parameter returning the list of spreadsheets from a Google Drive that the user has access to.

Errors:

Error Class Package Description
GoogleDriveError irpa_googleworkspace Thrown if a call to the google drive api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope or provided query with other mimetype than sheet.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Get Cell Values (Google Sheet)

Return the values of a specified cell range in Google Sheet.


Technical Name Type Minimal Agent Version
getCellsValues asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
spreadSheetId string mandatory ID of the spreadsheet in which you want to get cell values.
range irpa_googleworkspace.SheetRange mandatory The range of cells to get data.
majorDimension irpa_googleworkspace.enums.MajorDimension optional Select 'rows' or 'columns' depending on the cell range you want to specify.
valueRenderOption irpa_googleworkspace.enums.ValueRenderOption optional Select the rendering of the cell values in the output.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
cellsData irpa_googleworkspace.ValueRange Parameter returning the data of the specified cells.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google drive api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope or invalid range provided.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Set Cell Values (Google Sheet)

Set the values of a specified cells range in Google Sheet.


Technical Name Type Minimal Agent Version
setCellsValues asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
spreadSheetId string mandatory ID of the spreadsheet in which you want to set cell values.
range irpa_googleworkspace.SheetRange mandatory The range of cells to set data.
values Array. mandatory The multidimensional array of values to be set in the cells based on major dimension. This input accepts both single dimensional and two dimensional arrays (Max 2 dimensions only). In case of single dimensional array, we accept values in csv strings ['1,2,3,4', 'A,B,C,D,E'] in which each string will represent major dimension. In two dimensional array, each inner dimensional array represents an row or column based on major dimension. for example [[1,2,3,4], ['first', 'second', 'third', 'fourth']].
majorDimension irpa_googleworkspace.enums.MajorDimension optional Select 'row' or 'columns' depending on the cell range you want to specify. 'rows' is set by default.
valueInputOption irpa_googleworkspace.enums.ValueInputOption optional Parameter to define how the values should be set in the cells: select 'userEntered' to set the values as the user typed them into the UI, or 'raw' to set the values as-is. 'userEntered' is set by default.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
isDataUpdated boolean Returns 'true' if the data was successfully set.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google drive api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope or with invalid range or invalid values array.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Get Last Column (Google Sheet)

Get the last column in Google Sheet.


Technical Name Type Minimal Agent Version
getLastColumn asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
spreadSheetId string mandatory ID of the spreadsheet in which you want to get the last column.
sheetTitle string mandatory Title (name) of the sheet in which you want to get the last column.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
lastColumn string Parameter returning the last column in the sheet.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope or invalid Sheet title.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Get Last Row (Google Sheet)

Get the last row in Google Sheet.


Technical Name Type Minimal Agent Version
getLastRow asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
spreadSheetId string mandatory ID of the spreadsheet in which you want to get the last row.
sheetTitle string mandatory Title (name) of the sheet in which you want to get the last row.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
lastRow number Parameter returning the last row in the sheet.

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope or invalid sheet title.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Convert Column Index to Name (Google Sheet)

Convert a column index to A1 name in Google Sheet. E.g: An input index 1 will return A.


Technical Name Type Minimal Agent Version
columnIndextoName synchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
columnIndex number mandatory The index of the column in a sheet (A = 1).

Output Parameters:

Name Type Description
columnName string Parameter returning the name of the column in the alphabet (1 = A).

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Convert Column Name to Index (Google Sheet)

Convert a column name to an index in Google Sheet. E.g: An input A will return 1.


Technical Name Type Minimal Agent Version
columnNameToIndex synchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
nameOfColumn string mandatory The name of the column in a sheet (A, B, XT, CD).

Output Parameters:

Name Type Description
columnIndex number Parameter returning the index based on the specified column name (A = 1).

Errors:

Error Class Package Description
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Get Row From Cell (Google Sheet)

Get Row From A1 Notation. E.g. : For cell notation CT25 will return 25.


Technical Name Type Minimal Agent Version
getRowFromCell synchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
cellNotation string mandatory The index of the row in the sheet (A1, CT25).

Output Parameters:

Name Type Description
cellRow number Index of the row of the corresponding cell block.

Errors:

Error Class Package Description
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope or Invalid cell notation is provided.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Get Column From Cell (Google Sheet)

Get Column From A1 Notation. E.g. : For cell notation CT25 will return CT.


Technical Name Type Minimal Agent Version
getColumnFromCell synchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
cellNotation string mandatory The name of the column in the sheet (A1, CT25).

Output Parameters:

Name Type Description
cellColumnName string Name of the column of the corresponding cell block.

Errors:

Error Class Package Description
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope or if invalid cell notation is provided.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Import and Replace (Google Sheet)

Import data and replace an existing spreadsheet.


Technical Name Type Minimal Agent Version
importReplace asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
location irpa_googleworkspace.enums.Location mandatory The type of location from which to pick the data to import, either from a local file system or from a Google Drive.
pathOrDriveFileId string mandatory Depending on the defined location, this parameter is either the ID of the file from Google Drive or the local file system path.
existingSpreadSheetId string mandatory The ID of the spreadsheet in Google Drive that will be replaced.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
spreadSheetDetails irpa_googleworkspace.spreadSheetDetails Parameter returning the details of the updated spreadsheet, like its ID, name, and URL for example.

Errors:

Error Class Package Description
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
GoogleDriveError irpa_googleworkspace Thrown if a call to the google sheets api fails.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Import and Create (Google Sheet)

Import data and create a new spreadsheet.


Technical Name Type Minimal Agent Version
importCreate asynchronous WIN-2.0.0

Input Parameters:

Name Type Attributes Default Description
location irpa_googleworkspace.enums.Location mandatory The type of location from which to pick the data to import, either from a local file system or from a Google Drive.
pathOrDriveFileId string mandatory Depending on the defined location, this parameter is either the ID of the file from Google Drive or the local file system path.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
spreadSheetDetails irpa_googleworkspace.spreadSheetDetails Parameter returning the details of the newly created spreadsheet, like its ID, name, and URL for example.

Errors:

Error Class Package Description
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
GoogleSheetsError irpa_googleworkspace Thrown if a call to the google sheets api fails.
GoogleDriveError irpa_googleworkspace Thrown if a call to the google sheets api fails.
InvalidArgument irpa_core Thrown if this activty is used without the GoogleDriveScope.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error