"Invoke Code" Activity

Created by Akabot Support, Modified on Tue, 16 Dec, 2025 at 1:57 PM by Akabot Support

Table of Contents

  1. Activity Program Name

  2. Description

  3. Properties

  4. 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

Property Category

Property Name

Input Field

Description

Misc

Public

Checkbox

Logs variables and arguments within the activity to the log file and pushes them to Center. (For details, refer to "About the Public Property").

Display Name

Custom String

Reflected as the activity name in the Designer Panel.

General

Continue on Error

Boolean Value

Determines whether to continue execution even if an error occurs.

Input

Code

Code Input

The code to be executed.

Arguments

Create Arguments

Parameters that can be passed to the invoked code.


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

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article