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.
- 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
- 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:
- About Storage Buckets
- Storage Buckets details in UiPath.Orchestrator.dll.config
- Managing Storage Buckets
- Verify if Robot user is having the right privileges in the role at the folder level for Storage Files and Storage Buckets.
- Check if Robot user is added to the folder where the Storage Buckets files are located .
- If familiar with Rest API calls, check the Orchestrator swagger documentation for Buckets operations: https://ORCHESTRATOR_URL/swagger/index.html#/Buckets
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.
- Assume creating an Orchestrator Storage Bucket in a folder (in this case is the Shared folder)
Results:
- Then upload some files pressing on the Upload new file button
- Use the Browse button to select the file stored locally (the full path will be like \DataTable.zip)
- Go to Studio and create a new process -> Add a sequence to the Main.xaml file
- Add an Assign activity, create a variable StorageBucketName and for value add the name of the storage bucket in String format
Example:
- 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)
- Add a Log Message activity
Log Level: Info
Message: String.Format("Display the names of all the files from {0}",StorageBucketName)
- Add a For Each activity as below
Make sure that in Type Argument of the For Each activity, selecting the .Net Type UiPath.System.Activities.StorageFileInfo
- 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)
- To display the TextResults, add a Log Message activity
Results:
- 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"
- In order to check the file content, add a new Read Storage Text activity
- Display the content with a Log Message activity
Results:
Text: "New document content:"+ vbCr + TextResults
- In order to upload a file to Storage Bucket, use the Upload Storage File activity
Path: "C:\***USER ****\DataTable.zip"
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
- 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)
Results: