Skip to main content
Nintex Community Menu Bar
Solved

How to get variables from a C# code action?

  • August 6, 2020
  • 2 replies
  • 29 views

I see that RPAEngine.GetVar() works in VB.net but not in C#.  How can I access variables from C#?

Best answer by Sasan

Lewis,

We need to add to this capability.  In the mean time we might have a work around that we are testing.  We will keep you posted.

Thanks

Sasan

2 replies

Sasan
Nintex Employee
Forum|alt.badge.img+11
  • Nintex Employee
  • 143 replies
  • Answer
  • August 8, 2020

Lewis,

We need to add to this capability.  In the mean time we might have a work around that we are testing.  We will keep you posted.

Thanks

Sasan


  • Nintex Employee
  • 1 reply
  • August 10, 2020

Hello,

We do not currently support RPAEngine.GetVar for the C# action, and we have created a backlog item to implement this in the future.

RPAEngine.GetVar is supported for the VBScript action, so you may be able to use this action as a workaround.

This is a working example using both RPAEngine.SetVar & RPAEngine.GetVar in a VBScript action where VariableA exists as a Text variable in the the botflow.

 

Dim strValue If RPAEngine.SetVar("VariableA", "First Value") = True Then Msgbox "Success", vbInformation, "Result" Else Msgbox "The value could not be set.", vbCritical, "Result" End If If RPAEngine.GetVar("VariableA", strValue) = True Then Msgbox strValue, vbInformation, "Result" If RPAEngine.SetVar("VariableA", "NewValue") = True Then Msgbox "Success", vbInformation, "Result" Else Msgbox "The value could not be set.", vbCritical, "Result" End If Else Msgbox "The value could not be retrieved.", vbCritical, "Result" End If

 

Thanks,

Bo