MultipleAssign

Estimated reading: 2 minutes 1478 views

This activity lets you assign values to multiple variables at once, avoiding the need for multiple Assign activities. This activity is commonly used for initialization purposes before extensive processes, eliminating the need to set up multiple Assign activities.

Properties

MISC

DisplayName: Displays the name of the activity. The activity name can be customized, which aids in troubleshooting.

Example

Here’s an example of how “MultipleAssign” activity is used –

In the following example, I am declaring three “Integer” variables and using the multiple assign activity, I am going to perform a simple calculation.

1. Open an existing workflow or create a new solution.
2. Create three variables from the “VariablePanel” with “Integer” as datatype.
3. Now, drag and drop the “Multiple Assign” activity into the workflow and set it as start node.
4. In the “TO” property, enter the value as “Variable1” and pass the value as “2000” in the “Value” property.
5. Now, selecting the “Add” option to add multiple variables
6. In the “TO” property, enter the value as “Variable2” and pass the value as “745” in the “Value” property
7. Again, I am choosing the “ADD” option to add the third variable.
8. In the “TO” property, enter the value as “SUM” and pass the value as “Variable1 + Variable2” in the “Value” property.
9. Now, adding a “writeline” activity to view the output of the “SUM” variable.
a. Here, I am providing the value as “SUM.Tostring”.
b. The “.ToString” is advised to use along with any other data types other than string format. It converts any data type into string.
10. Now, execute the workflow to view the output.

The bot will execute and sums up the variable1 and variable2 to provide the output in writeline activity.

Share this Doc

MultipleAssign

Or copy link

CONTENTS