Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

Passing Variable to JS

I have a variable which is assigned as %NewVar%= Food.

Now I need to pass this %NewVar% in JS. But in JS its not accepting the variable which is in this format(%NewVar%). Is there any other way to pass. 


Best Answer

You can to create one new var in js to receive the %NewVar%


Exemple: 


var jsvar = "%NewVar%"; 


Hmmm, maybe you need to add quotes?   format("%NewVar%") 

Not sure if it's single ' or double quotes " in js.

Answer

You can to create one new var in js to receive the %NewVar%


Exemple: 


var jsvar = "%NewVar%"; 

Thanks for your reply, 



While passing we get as value true not the value of defined variable 

Hi,



I'm using it with no issues.


function lookForValue() {

              ...

              if (myRows[i].innerText == '%txtToSearch%') {

                            return i;

              ...

}



Login or Signup to post a comment