Now that we know how to display a dialog box on the screen and how to use variable to assign
values, let's go to the next exercise.
We'll try to pass data from one activity to another.
Let’s add an activity, an input dialog that will ask you to enter some text.
Selecting an activity allows you to inspect its "Properties".
This is located in the right side of your workflow.
This is where we put important data in different fields of our activity.
We can set the properties directly in the Properties section or we can double click
on it.
For Example, this Title is the name of the dialog box.
Let's name it, "Question Box".
And the Label will be "What's your name".
This one displays a text Inside the dialog box.
...and the Output...It's a variable!
and the variable name is automatically generated.
This one saves whatever the user has entered in the INPUT box.
Always remember, that many of the activities in our workflow requires both an INPUT and
an OUTPUT.
So in the case of our INPUT BOX, the output will be the text entered by the user.
Let's say you forgot to declare the variable in your workflow and you put the variable
name directly by not putting quotations to it.
UiPath will consider it as a variable or a special keyword used by UiPath.
Uipath will give you this little red exclamation icon which gives you the information about
the error.
To fix it, we always create a variable in the Variables section of our workflow before
using it.
Let's give it a proper name, by going here in the "Variables section".
Let's change this to "name".
I'm sure you're excited to see the result.
Let's make this as a start Node and let's give it a go real quick.
Now, let's say we want to capture the user input and return it in our message box?
Let's add a message box in our workflow.
Let's add a text value into our message box.
This time we will be using "name" which will call the value of our input box.
To make it simple, whatever user has entered, it will be displayed on the message box.
Let's run it to see the results!
Awesome!
Now you can see the passing of data from one activity to another using variables!
What if I wanted to add some text in the message box aside from the text entered by the user?
OK.
Now it's getting exciting!
Let's add another variable.
Let's call it "message".
We'll be using this one for our message box.
And the text that will be displayed will be the data of the variable "message".
There's a special Activity we can use,
We can use A+B Assign activity to concatenate the value of a variable and add string to
it.
The assign activity has a left part, (a variable) and a right part which is an expression.
Whatever the value of the expression on the right, it stores it in the variable on the
left.
So, we put the variable of the message box here in the left side.
On the right side, we'll put our expression "Hello" +name.
The "+" operator will concatenate the word "Hello" and the text entered by the user which
is stored in the variable called "name".
Now let's review what we have done so far.
First, Our input box have a variable named "name" which will store the data entered by
the user Second, The A+B Assign Activity gives another
value to our message box by adding the word "Hello"
Lastly, our message box will display the data in the variable named "message"
Alright, are you ready?
Let's run it.
Perfect!
In the next video let's learn about conditions!