Skip to main content
Question

Darshan Hiranandani : Referencing RPA Variables in JavaScript Manual Input

  • December 31, 2024
  • 1 reply
  • 35 views

Forum|alt.badge.img+2

Hi everyone,

I’m Darshan Hiranandani, trying to use the "Run JavaScript" action with manual input, but I need help with referencing a variable that I’ve already defined in RPA.

For example, I have a variable $variableInRPA$ (with a value like 50) and I want to use this variable inside a JavaScript block to add 10 to it and return the result.

Here’s what I have so far:

(function(){    var variableInManualInput = $variableInRPA$;     var result = variableInManualInput + 10;    return result;}());

However, I'm not sure if $variableInRPA$ will work directly in the JavaScript block.

Has anyone done something similar, and could you suggest how I might reference the RPA variable correctly in the JavaScript?

Looking forward to hearing your thoughts!

Thanks!
Regards

Darshan Hiranandani 

1 reply

Forum|alt.badge.img+7
  • Navigator | Tier 3
  • December 31, 2024

Hi ​@darshanhiranandani23 

The following post explains it pretty well:

Let me know if you need any further assistance.