Leggi e rivedi la documentazione di Automation Anywhere

Automation 360

Chiudi contenuti

Contenuti

Apri contenuti

Create a variable

  • Aggiornato: 2022/05/30
    • Automation 360 v.x
    • Crea
    • Spazio di lavoro RPA

Create a variable

Create a variable to store values.

Procedura

To create and configure a variable, perform the following steps:

  1. From the Bot editor, click Variables > Create variable (+ icon) at the top of the Variables menu.

    variable menu screenshot

  2. In the Create variable window, enter a descriptive name for the variable that is prefixed by a lowercase letter to indicate the variable type.
    For example, sCellValue to indicate a string data type.
    Nota:
    • You can use double-byte characters, such as Chinese, Japanese, or Korean characters, in a variable name. Intervallo Unicode supportato nelle variabili
    • Variables cannot be named Java keywords, such as String, Boolean, Integer, Public, and Finally.
  3. Opzionale: Immetti una descrizione.
    Recommendation: Provide meaningful variable description when defining input or output variables.
  4. Opzionale: Select the Constant (read-only) option to ensure values cannot be edited or overwritten.
  5. Scegli tra le seguenti opzioni:
    This field pertains to using a bot to run other bots. Consulta Task Bot package.
    • Usa come input: The variable holds a value that can be passed from the parent bot to a child bot. (Applicable only to a child bot)
    • Usa come 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.
    The following example illustrates when to select Use as input or Use as output in a variable.

    Suppose you want to add two numbers. The values are present in the parent bot, and the child bot performs the calculations. For the parent bot to transfer the values to the child bot, the two variables you created must be selected as Use as input so that the child bot can receive the values. Now, for the parent bot to receive the calculated value, the variable that stores the result of the calculation in the child bot has to be selected as Use as output.

    Nota: Ensure that you select the check boxes when you create a variable in the parent bot and the child bot. When you build the bot, and if you edit the selection of check boxes, it might impact your parent bot references, such as your parent bot might not work after this change.
  6. Select a data type from the drop-down list.
    For more information on data types, see Tipi di variabili.
  7. Opzionale: Enter a default value to assign to the variable.
    The values are NULL/empty by default.
  8. Fai clic su Crea.
    The variable appears in the Variables pane on the left side of the Bot editor.
    If you want to edit a variable, you can change its name and value but not its data type.
  9. To insert a variable into an action field, perform one of the following actions:
    • 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.
      Nota: Add a dollar sign at the start and end of the variable. Ad esempio, $myVariableName$.
    You can use the variable option and pass it as a parameter to open a file in packages such as XML, Excel basic, or Excel advanced. Per aprire file con estensioni diverse, utilizza l'opzione variabile per assegnare il percorso della cartella, il nome del file e l'estensione del file. First, create a variable for the folder path, $sFolder$. Then, for the files in the folder path, create two variables, one for file name $name$ and another for file extension $extension$. To open a file, combine the variables as a string, such as $sFolder$\$name$.$extension$. Affinché l'estensione funzioni con diversi tipi di file e diverse opzioni di apertura, è possibile aggiungere una logica condizionale.

Fasi successive

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.
Invia feedback