How to Use Node.js with JavaScript in Combination with UiPath

@Valeriy

Hello Valeriy,
welcome in the UiPath Community.

I tried this sequence …

image

… with this code in the file TestScript.003.js …

//-Begin----------------------------------------------------------------

// Hello from Node.js 18.9.0
console.log(`Hello from Node.js ${process.versions.node}`);

var myArgs = process.argv.slice(2);

myArgs.forEach((val, index) => {
  // 0: String with Spaces
  // 1: 1
  // 2: 2.5
  console.log(`${index}: ${val}`);
});

var Arg1 = myArgs[0];
// String with Spaces
console.log(`${Arg1}`);

//-End------------------------------------------------------------------

… with this properties …

image

… and this result.

image

I use VB language convention.

image

The arguments are a string in double quotes, an integer and a float. To get access to the content of the command-line arguments use process.argv. process.argv delivers all arguments as string[].

Best regards
Stefan

1 Like