I'm trying to develop a flow -which requires javascript to be executed within steps. Question - How can I change a variable within javascript code?
Solved! Go to Solution.
Hello @itssujeeth,
If you desire to change the value of a PAD variable using JavaScript, that can be done by echoing the result of your JS calculation using the command "WScript.echo("String") and then setting the variable that needs to be changed to the output result of the "Run JavaScript" action - screenshot below:
This will set the variable %JavascriptOutput% to "test". Hope it helps!
I am a bit confused with your question, "Change a variable". You can click on fx and reference a variable.
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Sorry for being vague in my question. As part of my flow, I need a variable to be assigned a new value which needs to be calculation using a logic. An easy approach tried was to write a javascript implementation for this logic and trying to assign the value. But it doesn't work
Hello @itssujeeth,
If you desire to change the value of a PAD variable using JavaScript, that can be done by echoing the result of your JS calculation using the command "WScript.echo("String") and then setting the variable that needs to be changed to the output result of the "Run JavaScript" action - screenshot below:
This will set the variable %JavascriptOutput% to "test". Hope it helps!
I can use at input variables all pad variables (text format), but as output variable only one (wscript.echo...)? Is there any other option that I can output more variables ore change other pad variables value?