Thank you so much.
The transcript of the video i followed is given here.
The first method of creating variables is from the context menu or with a keyboard shortcut. Note that Variables cannot be created if the Designer panel does not contain at least one activity, so let’s drag in a Sequence and add a Message Box.
In the Properties panel of the Message Box, right-click a field that can be edited, and select Create Variable from the context menu, or press Ctrl+K.
A Set Name field is displayed. Let’s write “myMessage” and press Enter. The variable is created. You may not use spaces when naming a variable, so capitalization is useful to distinguish a new word. As you become more advanced UiPath users, you will surely develop your own unique naming sequence for variables. Note that When creating variables like this, the type is automatically generated,
Depending on the selected property. As you can see here, “myMessage” was automatically created as generic value. The second method of creating variables is from the Variables panel.
In the Designer panel, click Variables then click the Create Variable line. A new variable with the default value is displayed. Note that when creating variables like this, the default type are String variables.
Using the Variables Panel you can view and edit the name, type and scope of each variable.
The scope of the variables is set when you create the variable and it is based on the activity that was highlighted when the variable was created.
Let’s see this in action. If we select “Sequence 1” and we click on Create Variable, the scope is set to “Sequence 1”, but if we click on “Sequence within Sequence” and we click on Create Variable, the scope is set to “Sequence within Sequence”.
The scope of the variable is important because the variable will only be recognized within the specified scope.
Using the Properties panel to create a variable has the same behavior regarding the scope of the created variable.
In the Variable Panel you can also set a Default value for the variables. Let’s set the default value for Variable1 to “Hello”.
Now that we have a default value, let’s drag in a Message Box and add Variable1 as Text for the Message Box.
Next, let’s create a new variable for the Output Property and let’s call it “buttonText”.
Now let’s drag in a new Message Box to display the variable “buttonText”.
And finally let’s run the program. We get the default value of the first variable and after we press ok, we see that the Button Text was saved in the variable and we displayed it.
In this video we’ve learned what variables are, the importance of the variables, how they are created, and how we can edit them. We also went through a short demo on how to use a variable.
And i got error that Button Text is not declared.