Creating variables using Script mode
Create variables in the script using the Script development view.
About this task
Use variables to provide input values or to receive output values. You might create these variables using the Script development view. Script development view is the interface in IBM RPA Studio where you can develop your bot using the IBM RPA script language. See more details in Script mode.
Procedure
- Log in to the IBM RPA Studio.
- Create or open an script. It has the extension
.wal
. - Click the Script tab.
- In the script line, enter the
defVar
command verb. - Enter the
--name
input parameter. - Enter the variable name.
- Enter the
--type
input parameter. - Enter the variable type.
- Optional: Enter the
--value
input parameter. - Optional: Enter the variable default value.
- Optional: Enter the
--parameter
parameter. - Optional: Enter the
--output
parameter. - Optional: Enter the
--required
parameter.
What to do next
You can change the default values of variables while the script runs. Default values are assigned to variables when you create them without value. In most cases, simple and object variable types initialize with the value null
. You
can see the exceptions in Default values of variables.
To assign values for variables in your script, see Assigning values to variables using Script mode for instructions.