Support Portal

for ProcessRobot and WinAutomation

Start a new topic

Execute Javascript using built-in objects

Hello, community.


The action Execute Javascript Function on Web Page can use the available functionalities of the Browser where the JS code is executed. However, The environment where Run Javascript is executed is not clear to me. I do not know how can I use built-in objects to perform complex operations inside this action. For instance, Run Javascript seems to be useful to manipulate json objects (as they are native javascript serialized objects). However, friendly serialization of objects depends on JSON object  (https://www.w3schools.com/js/js_json_intro.asp) that is not available.


Thank you in advance.

1 Comment

ADMIN

Hello Hector,


Please note that the Run Javascript Action is used to execute a custom JS code and store the output in a WA variable, which may then be used in the automation process.


For instance, you can use it for operations which would not directly be possible using the regular actions and then use the result in your process.


While handling JSON Objects, you can convert the JSON output into custom object by using action called "Convert Json to Custom Object". Accordingly you can work on same object.


If you're trying to use any specific operation with this action, please let us know the details so that we may help you out.


You may refer to the following articles for some samples:

Calculate the last day of current month using Javascript 

Incrementing characters like numbers 

Calculations with Javascript 

Square Root with JavaScript 

execute javascript return value 


Hope this helps...

Login or Signup to post a comment