How To Work With Orchestrator Storage Buckets In Studio?

How to work with Orchestrator Storage Buckets in Studio?

Note: This is an internally tested tutorial for creating an Orchestrator Storage Bucket and how to perform some operations with Orchestrator Storage Bucket files in Studio. Adapt it based on the internal requirements.

  1. First of all make sure that in C:\Program Files (x86)\UiPath\Orchestrator\UiPath.Orchestrator.dll.config these lines are filled with data



Read more on Buckets.Available.Providers .


Allow access to a list of folders or network shares. Read more on Buckets.FileSystem.Allowlist

  1. After checking, adapting based on the requirements, and saving the UiPath.Orchestrator.dll.config file, restart the Orchestrator server from IIS. More details can be found at these references:

  1. Verify if Robot user is having the right privileges in the role at the folder level for Storage Files and Storage Buckets.

1.png

  1. Check if Robot user is added to the folder where the Storage Buckets files are located .

  1. If familiar with Rest API calls, check the Orchestrator swagger documentation for Buckets operations: https://ORCHESTRATOR_URL/swagger/index.html#/Buckets

2.png

Read more on Permissions Per Endpoint .

Tutorial with creating an Orchestrator Storage Bucket and how to perform operations with Orchestrator Storage Bucket files in Studio.

  1. Assume creating an Orchestrator Storage Bucket in a folder (in this case is the Shared folder)

1.png

Results:

2.png

  1. Then upload some files pressing on the Upload new file button

3.png

  1. Use the Browse button to select the file stored locally (the full path will be like \DataTable.zip)

4.png

  1. Go to Studio and create a new process -> Add a sequence to the Main.xaml file

  1. Add an Assign activity, create a variable StorageBucketName and for value add the name of the storage bucket in String format

Example:

3.png

  1. To display the list of all files in the bucket location, use a List Storage Files activity

Folder Path: "Shared" (the Orchestrator folder)

Output: StorageResults (create a variable with this name)

Directory: "\"

Recursive: True

Storage Bucket Name: StorageBucketName (the variable created at the 4th step)

5.png

  1. Add a Log Message activity

Log Level: Info

Message: String.Format("Display the names of all the files from {0}",StorageBucketName)

6.png

  1. Add a For Each activity as below

7.png

Make sure that in Type Argument of the For Each activity, selecting the .Net Type UiPath.System.Activities.StorageFileInfo

8.png

9.png

  1. For reading a text file from Storage Bucket file, use the Read Storage Text activity as bellow

Encoding: "utf-8"

Reference: Supported Character Encoding

Result: TextResults (create a new variable with this name)

6.png

  1. To display the TextResults, add a Log Message activity

10.png

Results:

11.png

  1. To write (this operation will override the content in your file) in the bucket storage file, use the Write Storage Text activity

Text: "Username; Identifier;First name;Last name

smith65;5080;Jamie;Smith"

12.png

  • In order to check the file content, add a new Read Storage Text activity

13.png

  • Display the content with a Log Message activity

14.png

Results:

15.png

Text: "New document content:"+ vbCr + TextResults

  1. In order to upload a file to Storage Bucket, use the Upload Storage File activity

Path: "C:\***USER ****\DataTable.zip"

5.png

Folder: "Shared" (folder from Orchestrator)

Destination: "\DataTable.zip" (make sure to add \ before the folder name, otherwise errors will be thrown in Orchestrator)

Storage Bucket Name: StorageBucketName

16.png

  1. In order to download locally the Storage Bucket file, use the Download Storage file activity as below

Folder: "Shared" (folder name from Orchestrator)

Path: "\DataTable.zip"

Storage Bucket Name: StorageBucketName

Destination: "C:\***USER***\Orchestrator_bucket\DataTable.zip" (local path of the folder including the file name and extension)

17.png

Results:

18.png