Convert Value

You can use this step to convert a manually specified value or, together with an extract step, to convert an extracted value.

You can add this step directly from the Robot workflow or from the State pane by right-clicking a value and clicking Insert Step > Convert.

To perform the conversion for a manually specified value, the Convert Value option must be selected in the drop-down list. To perform the conversion for an extracted value, in the drop-down list, select one of the extract steps.

Properties

Convert Value

The source value to convert.

Evaluate Expression
Contains a list of conversion functions suggested for use on a value. The function list suggested for a particular value is limited, depending on the value type. To specify a conversion function, in the step context menu, click Evaluate Expression, and then do either of the following:

  • Select the required function from the list of suggested functions.
  • Click Plain to manually type the required function. For example, if you need to extract a text that represents an integer and store it in an Integer variable, you can use the expression $initial.integer().

For more information on the supported functions and examples, see Expressions.

A converter can contain one or more Evaluate Expression steps.

Store Current In
Stores a converted value in a variable of specified type. The type of the value must match that of the variable and can be one of the following: Integer, Boolean, Number, or Text.
The converter can contain one or more Store Current In steps. For example, this can useful if you need to extract a full name of a person and store it in two variables, such as for the first name and last name respectively, inside the same converter group.

A converter group can also contain the following set of action steps:

Example: Capitalize expression "hello world"

The following example demonstrates how to capitalize the expression "hello world" and store it in a variable of type text.

Inside a converter group, if you need to undo a change to the workflow state or see the state at a certain preceding flow point, you can simply go back inside the group of conversion steps by executing the required preceding flow point. Also, if you change the workflow before the current flow point, the workflow state is adjusted automatically, so you do not need to reexecute the conversion steps.

  1. Add a Convert Value step to your automation workflow and configure it as follows.

    1. Under Convert Value, type "hello world".

    2. After the expression, right-click the flow point and click Evaluate Expression > Capitalize: (Text) -> Text.

  2. After you execute the first part, the initial (given) value of the "hello world" expression is assigned to the variables $initial and $current.



  1. As you continue the execution, the expression is capitalized by the converter (note =$current.capitalize() in the following example), the variable $current is assigned a new value, "Hello World", while the $initial variable value remains unchanged. The new value of the $current variable, "Hello World", is stored in the variable text of type text after the Store Current In is executed.



For more information on the $initial and $current variables, see Data Conversion.