Output of JavaScript

How to get the output returned by the JavaScript activity?

Execute Js component in Automation Studio, “Select Output” and assign the return value. Define the Output parameter in Parameter bar.

Refer Link for more details -


HI @sumit.sagar

I tried selecting the argument, but it is not getting the value of my java script variable.

Whether my argument name should de same as javascript variable name?

Hi @Mantri,

If you are using Chrome browser in your automation, you have to use return statement to pass the value out of javascript activity. It is not mandatory to have the argument name is same as javascript variable name. Here is the sample code.

Following script checks if the username control is present in the webpage and returns true or false as an output.
var isElementFound = “false”;
var usernamecontrol = document.getElementById(“txtusername”);
isElementFound = “false”;
isElementFound = “true”;
return isElementFound;

Hi @rajasri.muthaiya

Using the return statement I was able to capture the return value

1 Like