Google Gsuite-Ownership can only be transferred to another user in the same domain as the current owner

Hello,
I have created a bot that creates a new Google spreadsheet, push data then Create file permission (change Owner). I’m using Google GSuite activities.

The Spreadsheet is created successfully and I’m able to get the created sheet URL and ID.

However when changing the sheet owner (Activity: Create file permission), my UiPath code is generating an error message:

Ownership can only be transferred to another user in the same domain as the current owner."] Location[ - ] Reason[ownershipChangeAcrossDomainNotPermitted] Domain[global]

Questions/Help needed:In order to investigate/solve the permission issue that I have, below are my questions-

Who is the default owner of the new created spreadsheets?

Who is the user’s default parent folder? How I can access to it?

Is there a setup that I could change in GCP project: Default owner/Parent Folder

How I can access all the spreadsheets I have created by running the bot? The url is not working

Below some details:

1- In GCP, I have enabled required libraries:GSuite , Google Sheet, Google Drive

2- I have also, generated a service account key required for UIPath authentication to GSuite services.

My service account email is: [pg-ca-p-app-xxxxx@appspot.gserviceaccount.com]


3- The new sheet owner should be my corporate email: T.B@xxx.com

4- error message from UiPath:
19.4.2+Branch.master.Sha.e17a3bedca2a7da0d0b716b5f8f765d1d5ef1ddc

Source: Create File Permission

Message: Google.Apis.Requests.RequestError
Bad Request. User message: “Sorry, cannot transfer ownership to T.B@xxx.xom. Ownership can only be transferred to another user in the same domain as the current owner.” [400]
Errors [
Message[Bad Request. User message: “Sorry, cannot transfer ownership to T.B@xxx.xom. Ownership can only be transferred to another user in the same domain as the current owner.”] Location[ - ] Reason[ownershipChangeAcrossDomainNotPermitted] Domain[global]
]

Exception Type: Google.GoogleApiException

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
Google.GoogleApiException: Google.Apis.Requests.RequestError
Bad Request. User message: “Sorry, cannot transfer ownership to T.B@xxx.xom. Ownership can only be transferred to another user in the same domain as the current owner.” [400]
Errors [
Message[Bad Request. User message: “Sorry, cannot transfer ownership to T.B@xxx.xom. Ownership can only be transferred to another user in the same domain as the current owner.”] Location[ - ] Reason[ownershipChangeAcrossDomainNotPermitted] Domain[global]
]

at Google.Apis.Requests.ClientServiceRequest1.<ParseResponse>d__34.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Google.Apis.Requests.ClientServiceRequest1.d__30.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.GSuite.Activities.CreateFilePermission.d__38.MoveNext()
— End of stack trace from previous location where exception was thrown —
at UiPath.GSuite.Activities.TaskAsyncCodeActivity`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Any help is appreciated!

1 Like