UiPath Data Service

The UiPath Data Service Guide

Uploading file fields in entity records

Using Studio you can easily manipulate specific files of an entity record. These activities allow you to execute operations such as upload, download, or delete specified files of a specified field of an entity record.

The following example contains a main XAML demonstrating how to upload a file to Data Service, after downloading it from Olympics games related Wikipedia pages.

Prerequisite step 1: Create entities in the Data Service

Following the steps detailed on the Creating an Entity page, we created an entity for storing information about the Olympic games.

The Olympics entity has the following fields: Name (text) and Logo (file).



System built-in fields are automatically added to your entity in order to provide details about its creation.


Prerequisite step 2: Import the entities in Studio

Import the entity inside your workflow in Studio, as explained in the Importing Entities page.

The following workflow scrapes information and images about a certain Olympics edition, maps the found data to arguments, and passes them along to the main workflow.


Step 3: Build the workflow

Query related records

We'll use the Query Entity Records activity to pull up a list of records from the Olympics entity from Data Service by setting up the name variable. This goes through all records from the Name field and outputs them in the existingRecords variable to be used in the following If activity.



Add the If activity allows us to take one of the following two different courses of action, depending on whether the cont for the existingRecords variable is 0 or not:


1. If a record does not exist, create it and assign values to it

If no records are found meaning that the existingRecords=0 condition is met, create a new Sequence, use the Multiple Assign activity to assign values to the olympics and olympics.Name variables and the Create Entity Record activity to add the collected information to the Data Service.

:white-check-mark: You can use the information available in the Using Entities in Projects page Create Data Records section example.


2. If a record already exists, assign values to it

If a record is found, meaning that the existingRecords=0 condition is not met, use the Assign or Multiple Assign activity to assign the value to the existingRecords variable.


Upload file to record field

We use the Upload File to Record Field activity and upload the created file to the Logo field from the Olympics entity record.


Delete the local file

Remove the file that was downloaded locally from Wikipedia to our machine after uploading it to Data Service by using the Delete activity.


Display the value of the variable in the Output panel

Add the Write Line to display the value of the string variable, for this example we've added the olympics.Name, to the Output panel.


Once finished, your project should look like this:


Updated 29 days ago

Uploading file fields in entity records

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.