Skip to main content
Nintex Community Menu Bar
Solved

How to escape dollar sign to avoid variable reference

  • April 20, 2023
  • 3 replies
  • 439 views
  • Translate

Forum|alt.badge.img+10

Hello,

 

We’re trying to use the “Run Script” action to run a powershell script. Powershell uses $ symbols to signify a powershell variable.  We’re noticing that scripts don’t run correctly anytime there’s more than 1 $ in the script.  My assumption is that when the script runs, it’s trying to evaluate everything between $ symbols as an RPA variable. If this is the case, how can we escape a $ symbol so that Nintex RPA doesn’t try to interpret it as an RPA variable?


I’m assuming this is an issue where ever variables can be used. As an example, using this “Set value” action:

 

Results in this output:

 

Any advice would be appreciated. 

Best answer by Garrett

 

View original
Did this topic help you find an answer to your question?

3 replies

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • April 20, 2023

Hi @bsikes 

You are typing to insert a variable value within a variable.
Since the variable is not declared, it evaluates as -blank-
That's why variable testdollar variable evaluates as “Debits: 456.00

 

https://help.nintex.com/en-US/kryonrpa/22.9.1/Content/AdvancedCommands/VariableCommands/Set_Value.htm

Translate

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • Answer
  • April 20, 2023

 

Translate

Forum|alt.badge.img+10
  • Author
  • Scout
  • 129 replies
  • April 20, 2023

Thanks for the response @Garrett 

 

I assumed that’s what was happening - I just also assumed there would be a way to escape the special character to indicate it should literally be there.  That being said, using “Set Value” to set a variable equal to $, and then using that variable for the script did work. 

 

Also, thanks for screenshot of help doc. I looked at that page quite a few times and for some reason never saw that note. 

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings