web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Executing JavaScript

(0) ShareShare
ReportReport
Posted on by 3

I am experimenting the PAD Scripts.  I got the "Run VBScript" to work, now trying the "Run JavaScript" action.

 

I expected the statement: console.log("Text Here") to populate the return variable "JavascriptOutput", but it thru an exception.  Based upon a response from another user, I tried using "WScript.echo("Text Here") and it worked.

 

From what I have read, 'WScript" is can be used in JScript or VBScript, but the description says "Run JavaScript".  I don't know if this is an error or what.  I am an experienced reactive web developer, so I would like to be able to leverage JavaScript when possible.  

 

dragsdale_0-1616161143238.png

Thanks.  I am excited by the potential of PAD, it could be another game changer.

I have the same question (0)
  • Verified answer
    fraenK Profile Picture
    2,125 on at

    As you already figured out yourself, the runtime understands JScript, which is a ECMAscript based dialect from Microsoft. Console.log isn't part of the original spec, that's why it doesn't work.

     

    You could run your JavaScript code within a browser of your choice with:

    https://docs.microsoft.com/en-US/power-automate/desktop-flows/actions-reference/webautomation#executejavascript

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    A caution I just discovered with javascript outputting a variable from WScript.echo: this will append a CRLF to the end, and so when I was trying to concatenate strings into a filename box with the variable, it was sending an enter to the dialogue and exiting it. Was more difficult to find than I would have liked.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 223

#2
David_MA Profile Picture

David_MA 210 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 175

Last 30 days Overall leaderboard