Table of Contents
Activity Program Name
Description
Properties
Usage
1. Activity Program Name
RCA.Activities.Core.InvokeCode
2. Description
Up to Studio Version 2.0.2.0:
Quick Access: "Toolbox" > "Invoke" > "Invoke Code"
From Studio Version 2.0.3.0 onwards:
Quick Access: "Toolbox" > "Core" > "Invoke" > "Invoke Code"
The Invoke Code activity allows users to synchronously call VB.NET or C# code, pass input arguments, and return arguments to the calling workflow.
Tested Studio Versions: 2.0.5.0, 2.1.0.0
Note: Wording may vary slightly depending on the version.
3. Properties
4. Usage
This section provides an example of using the "Invoke Code" activity to sum up amounts from a data table.
Drag and drop "Core" > "Data Table" > "Build Data Table" onto the workflow.
Click on "Data Table", then enter product names and their corresponding prices, as shown in the image below.
(You can enter any values as needed.)
Assign a DataTable-type variable (e.g., dtSample) to the "Data Table" property.
If needed, refer to "Creating Variables" for more details.
Drag and drop "Core" > "Invoke" > "Invoke Code" onto the workflow.
Click "Edit Arguments" in the Invoke Code activity.
Enter the following arguments:
in_dtSample (Type: DataTable, Direction: Input, Value: dtSample)
out_inSum (Type: Int32, Direction: Output, Value: inSum)
Click "Edit Code" in the Invoke Code activity and enter the following code in the editor:
vb
CopyEdit
Dim row As DataRow
out_inSum = 0
For Each row In in_dtSample.Rows
out_inSum = CInt(row("Price").ToString) + out_inSum
Next row
Drag and drop "Core" > "Dialog" > "Message Box" onto the workflow.
Assign the inSum variable (of type Int32) to the "Text" property and append ".ToString" to convert it into a string.
Click "Home > Start" or press F5 to run the robot.
Verify that the total sum of the amounts entered in "Build Data Table" is displayed in the message box.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article








