Solved

How to get variables from a C# code action?

  • 6 August 2020
  • 2 replies
  • 11 views

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

icon

Best answer by Sasan 8 August 2020, 04:51

View original

2 replies

Userlevel 4
Badge +11

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

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

Reply