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.
Following the steps detailed in 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.
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.
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:
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.Name variables and the Create Entity Record activity to add the collected information to the Data Service.
You can use the information available in the Using Entities in Projects page Create Data Records section example.
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
We use the Upload File to Record Field activity and upload the created file to the Logo field from the Olympics entity record.
Remove the file that was downloaded locally from Wikipedia to our machine after uploading it to Data Service by using the Delete activity.
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 2 months ago