Create a variable
Create a variable to store values.
To create and configure a variable, follow these steps:
From the Bot editor, click (+ icon) at the top of the Variables
In the Create variable window, enter a descriptive name
for the variable that is prefixed by a lowercase letter to indicate the variable
sCellValueto indicate a string data type.Note:
- You can use double-byte characters, such as Chinese, Japanese, or Korean characters, in a variable name. Unicode range supported in variables
- Variables cannot be named Java keywords such as String, Boolean, Integer, Public, and Finally.
Enter a description.
Recommendation: Provide meaningful variable description when defining input or output variables.
- Optional: Select the Constant (read-only) option to ensure values cannot be edited or overwritten.
Select from the following options:
This field pertains to using a bot to run other bots. See Task Bot package.
- Use as input: The variable holds a value that can be passed from the parent bot to a child bot. (Applicable only to a child bot).
- Use as output: The variable holds a value that can be passed from a child bot to the parent bot. (Applicable only to a child bot).
- Both: The value can be passed in both directions.
- Neither: The variable is confined to this bot; it cannot be shared across other bots.
Select a data type from the drop-down list.
For more information on data types, see Variable types.
Enter a default value to assign to the variable.
The values are NULL/empty by default.
The variable appears in the Variables pane on the left side of the Bot editor.
To insert a variable into an action field, perform one of the
- Click F2 to open the variables list.
- Click the Insert a value icon, located on the right side of the field.
- Enter the variable name. As you type, the field generates suggestions of
existing variables.Note: Add a dollar sign at the start and end of the variable. For example,
Build a Go be Great bot: Follow the steps in this procedure for an example of how to create a variable and assign it to an action.