Saving files to SharePoint via Orchestrator are checked-out by default

I have a process that saves files to SharePoint and when the process is run via UiPath Assistant the file saves normally and can be opened by other users. When I trigger the process via Orchestrator the file is saved but checked out and cannot be accessed by other users. From what I have read it appears to be a permission of some sort between the UiPath Assistant running as the user, versus Orchestrator running as the User.

Has anyone come across this and found a way to stop them being checked-out?

Thanks

Craig…

Hi @craig.norton

If possible go to SharePoint Library Settings → Versioning Settings and set Require documents to be checked out before editing is equal to No or If checkout is required, explicitly Check-In the file after upload using a Microsoft 365 / SharePoint Check-In activity or REST API
Hope it helps
Thanks

Hi @craig.norton

Yes, this is a common SharePoint behavior. When you run the process via UiPath Assistant, it runs under your user context, so files are checked in automatically. When running via Orchestrator, it usually runs under the robot user account, which may not have full permissions, so SharePoint auto-checks out the file.

  1. Use a robot account with full “Edit / Contribute” permissions on the SharePoint library.
  2. After uploading the file in your workflow, add a “Check In File” activity or use the SharePoint HTTP Request activity to explicitly check in the file.
  3. Ensure that no “Require Check Out” setting is enforced in the library for that user.

Basically, the difference comes down to permissions and user context between Assistant and Orchestrator.

Hi @Monali_Vekariya and @nishiijain2000 . I have confirmed that “Check-out” is set to no. I have tried to do a forced check-in but keep getting an error “The request is malformed or incorrect.”

The steps I did was to use a “Get File or Folder” activity and pass the URL of the new file and save the Output (O365DriveRemoteItem). I then used this as the file on a Check-in/Check-out Activity.

How do a force a check-in via HTTP Request?

Thank you both for your assistance.

Craig…

@craig.norton

You can Use SharePoint REST API with HTTP Request to call /CheckIn() on the file reliably forces check-in
Hope it resolves the issue

@craig.norton

  1. Ideally the file would not be checked out…check the event viewer logs if some error has occurred while uploading
  2. for check in/checkout activity can you show the locals panel properties and activity configuration when error occurred

cheers

Hi @craig.norton

The issue is that SharePoint check-in cannot be done via Graph (O365DriveRemoteItem). That’s why the Check-In activity gives the “malformed or incorrect” error.

To force a check-in, use HTTP Request (Modern) with the SharePoint REST API:

POST

https://.sharepoint.com/sites//_api/web/GetFileByServerRelativeUrl(‘’)/CheckIn(comment=‘Robot check-in’,checkintype=0)

Add headers:

Accept: application/json;odata=verbose
Content-Type: application/json;odata=verbose

This works reliably when the job runs from Orchestrator.

Assistant runs under your user context, Orchestrator runs under the robot account, and SharePoint keeps files checked out unless explicitly checked in.