Read and Review Automation Anywhere Documentation

Automation 360

Close Contents

Contents

Open Contents

JavaScript package

  • Updated: 7/16/2021
    • Automation 360 v.x
    • Build
    • RPA Workspace

JavaScript package

The JavaScript package contains actions to run a JavaScript from a bot. These actions can run JavaScript on Windows, Linux, and UNIX based devices.

Before you start

  1. Open a JavaScript file, or specify the script you want to run using the Open action. You must associate the details of the file or script you want to run with a session name. Use this same session name for other JavaScript actions.
  2. Use the Run JavaScript action to run a function within a script or an entire script. You must use the same JavaScript session name established in the Open action.
  3. Close the JavaScript session after running the script.

    To review the bot launcher logs, navigate to C:\ProgramData\AutomationAnywhere\BotRunner\Logs\<current month>\Bot_Launcher-<today's date>.log.zip. Each zipped folder contains a file with data on the code execution, which is useful for debugging.

Actions in the JavaScript package

The JavaScript package includes the following actions:
Note: If you built a bot using actions from the JavaScript package from Build 5322 or earlier, the actions will be missing when you open the bot with the default package version. You must reinsert the actions and repopulate the fields.
Action Description
Close Closes the session.

Specify the same session name from the Open action.

Open Opens a JavaScript file.
  • In the JavaScript session field, specify a session name. Use this same session name for other JavaScript actions.
  • Choose one of the following options:
    • In the Import existing file option, select an existing JavaScript file.
      Note: If you are uploading a script from a file on your desktop, the file and any dependencies must be in a standalone folder. When you select a file for upload, all files and folders at the same folder level are uploaded.
    • In the Manual input option, enter the JavaScript.
Run JavaScript Runs a function within the JavaScript.
  • In the JavaScript session field, specify a session name. Use the same session name from the Open action.
  • Optional: Specify the function name to run and the arguments to pass to the function.
    Note: You can pass only a list variable as an argument for the function. You can use the list variable to pass multiple arguments of different data types such as Boolean, datetime, number, and string.
  • Optional: In the Assign the output to variable field, specify the variable. The Control Room shows a descriptive default variable name. If you create several output variables, subsequent variable names are appended with a -1, -2, -3, and so on to avoid duplication.

Resources

To learn more, access the course titled Did You Know that You can Write Inline Scripts Inside a Bot? course in Automation Anywhere University: RPA Training and Certification (A-People login required). This course introduces you to writing inline scripts within a command.

Send Feedback