- Getting started
- Licensing
- Setup and configuration
- Using Data Service
- Reference
- 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
Downloading 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 demonstrates how to automatically download from Data Service a specified file containing information from the Olympics games extracted from Wikipedia pages in order to use it for other operations.
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).
Check out the following pages:
- the Upload File activity as it contains details about how to use this activity to easily upload the logos;
-
the File page as it provides details on how to upload logos from the platform.
Note: System built-in fields are automatically added to your entity in order to provide details about its creation.
folder
variable. This goes through all records from the Name field and outputs them in the olympicsRecords
variable to be used in the following Input Dialog activity.
Select
label message and a Multiple choice
Input Type. In the Input array add the olympicsRecords
variable created previously for the Query Entity Records activity for which you'll apply the following function: olympicsRecords.Select(Function (o as Olympics) o.Name).ToArray
to set up the array of options to choose from.
selectedOlympics
variable to gather the output results.
olympicsRecords.First(Function (o as Olympics) o.Name = selectedOlympics)
variable created previously in the Input Dialogue activity to the new olympicEdition
variable.
folder
variable for the output folder path. You'll use this variable in the following Download File from Record Field activity.
folder
file from the Logo file of the olympicEdition.Id
entity record.
Path.Combine(folder, olympicEdition.Logo.Name)
in order to combine the following input parameters: folder
and olympicEdition
variables and the Logo and Name fields created within the Olympics entity.
The purpose of this activity is to invoke the full path of the file and open it in the default photo viewer or editor.
As an optional step, we've added an example of how to perform a file deletion which has been commented out to not delete the file at runtime. To do this we added the Comment Out activity. Here we included the following activities that won't be executed at runtime:
Please note that you can uncomment it to try it out.
Once finished, your project should look like this: