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

Module - Google Drive

Activities for interacting with Google Drive.

Author:
  • SAP Intelligent RPA R&D team

Activities

Rename File (Google Drive) New

Rename a file in Google Drive.


Technical Name Type Minimal Agent Version
renameFile asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
fileId New string mandatory The ID of the file in Google Drive you want to rename.
newName New string mandatory New name of the specified file in Google Drive.
timeout New number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
result New boolean Returns 'True' if the file has been renamed.

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 if the file Id or new Name parameters are not valid.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Move File (Google Drive) New

Move a file from one folder to another in Google Drive.


Technical Name Type Minimal Agent Version
moveFile asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
fileId New string mandatory The ID of the file in Google Drive you want to move.
destinationFolderId New string mandatory The ID of the folder in which you want to move the file.
timeout New number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
result New boolean Returns 'True' if the file has been moved.

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 if the file Id or folder Id parameters are not valid.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Get Folder By Name (Google Drive)

Retrieve one or several folders from Google Drive searching by names.


Technical Name Type Minimal Agent Version
getFoldersByName asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
name string mandatory The name of the folder to retrieve in Google Drive.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
metaDatas Array.<irpa_googleworkspace.googleDriveContentMetadata> List of folder names in the Google Drive matching the search.

Errors:

Error Class Package Description
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.
GoogleDriveError irpa_googleworkspace Thrown if a call to the google drive api fails.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Get File By Name (Google Drive).

Retrieve one or several files from Google Drive searching by names.


Technical Name Type Minimal Agent Version
getFilesByName asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
fileName string mandatory The name of the file to retrieve in Google Drive.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
metaDatas Array.<irpa_googleworkspace.googleDriveContentMetadata> List of file names in the Google Drive matching the search.

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.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Get File (Google Drive)

Retrieve one or several files from Google Drive.


Technical Name Type Minimal Agent Version
getFilesFromDrive asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
driveId string optional The ID of the Google Drive to get the files from. If you don’t set this parameter, 'My Drive' files will be fetched by default
query string optional Query to filter the results
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
metaDatas Array.<irpa_googleworkspace.googleDriveContentMetadata> List of files in the Google Drive matching the search.

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.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Get Folder (Google Drive)

Retrieve one or several folders from Google Drive.


Technical Name Type Minimal Agent Version
getFoldersFromDrive asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
driveId string optional The ID of the Google Drive to get the folder from. If you don’t set this parameter, 'My Drive' folders will be fetched by default.
query string optional Query to filter the results
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
metaDatas Array.<irpa_googleworkspace.googleDriveContentMetadata> List of folders in the Google Drive matching the search.

Errors:

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


Download File (Google Drive)

Download a file from Google Drive.


Technical Name Type Minimal Agent Version
downloadContent asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
fileId string mandatory The unique ID of the file to download.
localfolderPath string optional Parameter to specify the folder in which the file will be downloaded. The 'Downloads' folder in the file system is used by default.
name string optional Parameter to specify the name you want to give to the file once downloaded on your machine.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
MetaData irpa_googleworkspace.googleDriveContentMetadata The metadata of the file that was just downloaded.

Errors:

Error Class Package Description
InvalidArgument irpa_core Thrown if the download folder to does not exist or if this activty is used without the GoogleDriveScope.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
GoogleDriveError irpa_googleworkspace Thrown if a call to the google drive api fails.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Share To Email (Google Drive)

Share a file from Google Drive.


Technical Name Type Minimal Agent Version
shareContentViaEmail asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
fileId string mandatory The unique ID of the file in Google Drive that will be shared.
type irpa_googleworkspace.enums.UserType mandatory Parameter to define the type of user you want to share the file with.
role irpa_googleworkspace.enums.UserRole mandatory Parameter to define the permission the users will have on the shared file.
emailAddress string mandatory The email address of user or group you want to share the file with. You must set this parameter if the €˜type has been defined either as a user or a group.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
MetaData irpa_googleworkspace.googleDriveContentMetadata Metadata of the shared file.

Errors:

Error Class Package Description
InvalidArgument irpa_core Thrown if the email address has an invalid format or if this activty is used without the GoogleDriveScope.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
GoogleDriveError irpa_googleworkspace Thrown if a call to the google drive api fails.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Share To Domain (Google Drive)

Share To Domain. Anyone who is part of the domain will be able to access the file in their drive.


Technical Name Type Minimal Agent Version
shareContentToDomain asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
fileId string mandatory The unique ID of the file in Google Drive that will be shared.
role irpa_googleworkspace.enums.NonOwnershipRoles mandatory Parameter to define the permission the users will have on the shared file.
domain string mandatory The domain name of your organization in Google Cloud Platform. You must set this parameter if the €˜type has been defined as a domain.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
MetaData irpa_googleworkspace.googleDriveContentMetadata Metadata of the shared file.

Errors:

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


Share With Anyone (Google Drive)

Share Content With Anyone. Anyone who's got the link will be able to access the file.


Technical Name Type Minimal Agent Version
shareContentWithAnyone asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
fileId string mandatory The unique ID of the file in Google Drive that will be shared.
role irpa_googleworkspace.enums.NonOwnershipRoles mandatory Parameter to define the permission the users will have on the shared file.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
MetaData irpa_googleworkspace.googleDriveContentMetadata Metadata of the shared file.

Errors:

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


Delete File Or Folder (Google Drive)

Delete a file or a folder from Google Drive.


Technical Name Type Minimal Agent Version
delete asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
fileOrFolderId string mandatory The ID of the file or folder to delete.
timeout number optional Timeout for the activity. The default is 30000ms.

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.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error


Upload File (Google Drive)

Upload a file to Google Drive.


Technical Name Type Minimal Agent Version
uploadFileToDrive asynchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
filePath string mandatory Local path of the file to be uploaded.
name string optional Parameter to define the name you want to give to the file that will be uploaded to Google Drive. If not set, the file will keep its original name.
description string optional A short description of the file.
parentID string optional The ID of the parent file or folder to upload the file. If not set, the file will be uploaded to 'My Drive' by default.
readOnly boolean optional If set to €˜true€™, the uploaded file will be in read-only mode. It means that the file cannot be modified at all once uploaded to Google Drive.
writerCanShare boolean optional If set to true€™, only the users with the €˜writer permission can modify the file's permissions. This parameter is not applicable for files in shared drives.
keepRevisionForever boolean optional Set this parameter to true€™ to deactivate the retention default policy in Google Drive. By default, Drive empties files from trash 30 days after they're moved to trash.
copyRequiresWriterPermission boolean optional Set this parameter to true to disable the options to copy, print, or download the file for users with €˜reader€™ and commenter€™ permissions.
timeout number optional Timeout for the activity. The default is 30000ms.

Output Parameters:

Name Type Description
Metadata irpa_googleworkspace.googleDriveContentMetadata Metadata of the uploaded file.

Errors:

Error Class Package Description
InvalidArgument irpa_core Thrown if the file path does not exist or if the file has an invalid mime type or if this activty is used without the GoogleDriveScope.
SequenceError irpa_core Thrown if this activty is used without any authorization activity.
GoogleDriveError irpa_googleworkspace Thrown if a call to the google drive api fails.
Timeout irpa_core Thrown if the activity times out.
Error irpa_core Generic Error