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

  1. Log in to the IBM RPA Studio.
  2. Create or open an script. It has the extension .wal.
  3. Click the Script tab.
  4. In the script line, enter the defVar command verb.
  5. Enter the --name input parameter.
  6. Enter the variable name.
  7. Enter the --type input parameter.
  8. Enter the variable type.
  9. Optional: Enter the --value input parameter.
  10. Optional: Enter the variable default value.
  11. Optional: Enter the --parameter parameter.
  12. Optional: Enter the --output parameter.
  13. 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.