UiPath Studio

The UiPath Studio Guide

Generic Value Variables

The generic value variable is a type of variable with a wide range that can store any kind of data, including text, numbers, dates and arrays, and is particular to UiPath Studio.

Generic value variables are automatically converted to other types, in order to perform certain actions. However, it is important to use these types of variables carefully, as their conversion may not always be the correct one for your automation.

Example of Using a Generic Value Variable

To demonstrate how a generic value variable can be converted and used, let us create a project that displays the sum of two numbers in the Output panel, using generic value variables with different types of values.

  1. Create a Flowchart.
  2. Create three generic value variables, genNumber, genString and genSum.
  3. In the Default column for the genNumber variable, type 2, and for the genString variable, type "2." The first variable is interpreted as an integer, and the second one as a string.
  1. Add an Assign activity to the Designer panel and connect it to the Start node.
  2. In the Properties panel, in the To field, enter the genSum variable.
  3. In the Value field, type genNumber + genString.
  4. Add a Write Line activity and connect it to the Assign one.
  5. In the Properties panel, in the Text field, enter the genSum variable.
    The final project should look as in the following screenshot.
  1. Press F5 to execute your automation. Note that, in the Output panel, the sum of the two numbers is displayed.

This means that UiPath Studio knows that the genNumber is an integer and knows how to transform the generic value genString variable to an integer, so that it can add it to the first one.

However, keep in mind that this was our goal from the beginning. If we wanted to display the two variables in the Output panel as strings using this exact method, it would not have worked.

Click here to download the example.

Updated 4 years ago

Generic Value Variables

Suggested Edits are limited on API Reference Pages

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