data-service
2023.4
false
  • Getting started
    • Introduction
    • The User Interface
    • Data Service Configuration Checklist
    • Installing Automation Suite
  • Setup and configuration
  • Using Data Service
  • Reference
    • Data Service Studio Activities
    • API Access
  • Examples & Tutorials
    • Using Entities in Projects
    • Uploading File Fields in Entity Records
    • Downloading File Fields in Entity Records
    • Uploading Data From CSV Using Batch Activities
UiPath logo, featuring letters U and I in white
Data Service User Guide
Automation CloudAutomation Cloud Public SectorAutomation Suite
Last updated Apr 19, 2024

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.

Important:

The maximum size of a single file cannot exceed 10 MB, otherwise unexpected behavior might occur.

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 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).

Note: 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.

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 Data Service.

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:



Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.