cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

How to get variables from a C# code action?

Jump to solution

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

0 Kudos
Reply
2 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: How to get variables from a C# code action?

Jump to solution

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

View solution in original post

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to get variables from a C# code action?

Jump to solution

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