I’m currently working on a workflow in OpenRPA where I need to use the “Invoke Script” activity to type a password into a web input field. The password is stored in a variable (for example, myPassword), but I’m not sure how to access or pass this variable inside the JavaScript code of the Invoke Script.
How do I properly pass the value of myPassword to the script above?
I would really appreciate it if someone could explain how to bind or use OpenRPA variables in the “Invoke Script” activity.
Yeah, that is a little tricky.
You are basically sending a string with the script, so you need to concatenate the password into the string. Create a string variable, let’s call it script, and use that in the Script property of Execute Script. Let’s say your password is in a variable called MyPassword.
Then you can do something like this using the Assign activity. In the left field, type script, and in the right field type something like this:
then it’s not possible. There is no “parsing” of the script that can inject variables. So you need to do it the way i told you to, if you want to make it work.