cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
itssujeeth
Frequent Visitor

Power Automate Desktop - RPA javascript

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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:

adijain_1-1602879998990.png

 

This will set the variable %JavascriptOutput% to "test". Hope it helps!

 

View solution in original post

4 REPLIES 4
CFernandes
Super User III
Super User III

@itssujeeth 

 

I am a bit confused with your question, "Change a variable". You can click on fx and reference a variable.

 

CFernandes_1-1602869138648.png

 

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:

adijain_1-1602879998990.png

 

This will set the variable %JavascriptOutput% to "test". Hope it helps!

 

View solution in original post

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? 

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,251)