All templates
ScriptingIntermediate
Display JavaScript Output
Robomotion•Updated 6 months ago

Overview
Executes an inline JavaScript snippet and surfaces its return value in a dialog. Demonstrates the JavaScript Run node.
Display JavaScript Output
JavaScript is a web programming language used both on the client-side and server-side. Flows allow users to implement custom web automation behavior and handle web components through JavaScript code.
What Display JavaScript Output can do
- Run Node script (
Core.Process.StartProcess) — runsnodewith-e 'var variableName = "Hello World!"; console.log(variableName);', captures stdout intomsg.javascript_output. - Trim output (
Core.Programming.Function) — strips trailing CR/LF frommsg.javascript_output. - Message Dialog (
Core.Dialog.MessageBox,optType: info) titledOutput from JavaScript:showsmsg.javascript_output, thenCore.Flow.Stop.
Behind the scenes
console.logwrites to the Node.js process stdout, whichCore.Process.StartProcesscaptures intomsg.javascript_output— the dialog shows stdout, not a return value.- The inline snippet intentionally avoids any Node-specific APIs so it runs anywhere a
nodebinary is on PATH.