Split DataTable

Estimated reading: 3 minutes

The Split Data Table activity divides a source DataTable into a collection of smaller DataTable objects. You can control how the data is divided by selecting a Split Option, either Rows Per Table or Number Of Tables.

Rows Per Table: Each output table contains the specified number of rows. Any remaining rows are placed in the final table.
Number Of Tables: Rows are distributed as evenly as possible across the specified number of output tables.

Activity Designer Options

InputDataTable: Specify the source DataTable variable to split.

Properties

Input

InputDataTable: The source DataTable that will be divided into multiple output tables.

SplitOption: Determines how the source DataTable is split. Available options:
RowsPerTable: Creates output tables containing up to the number of rows specified in RowsPerTable.
NumberOfTables: Divides the source table into the number of output tables specified in NumberOfTables.

RowsPerTable: The maximum number of rows allowed in each output DataTable. This property is used only when SplitOption is set to RowsPerTable.

NumberOfTables: The number of output DataTable objects to create. This property is used only when SplitOption is set to NumberOfTables.

MISC

DisplayName: Specifies the display name of the activity in the workflow designer. The default value is SplitDataTable.

SkipOnError: Specifies whether workflow execution continues when the activity encounters an error.
True: Continues workflow execution when an error occurs.
False: Stops workflow execution when an error occurs.
None: Uses the default value, False.

Version: Displays the version number of the DataTable Automation package being used.

Output

OutputDataTables (List): Returns the collection of DataTable objects generated by the split operation.

Result: Indicates whether the activity executed successfully.
True: The activity executed successfully.
False: The activity failed due to an unexpected error.

How It Works

1. The SplitDataTable activity accepts a source InputDataTable and a configured SplitOption.
2. During execution, the activity reads the structure and rows from the source DataTable.
3. If SplitOption is set to RowsPerTable, the activity creates multiple output tables containing up to the specified number of rows in each table.
4. If SplitOption is set to NumberOfTables, the activity distributes the rows as evenly as possible across the specified number of output tables.
5. Each generated DataTable retains the same column names, data types, and schema as the source table.
6. When the total number of rows cannot be divided evenly, any remaining rows are placed in the final table for RowsPerTable mode or distributed as evenly as possible for NumberOfTables mode.
7. The collection of generated tables is returned through the OutputDataTables output property, and the execution status is returned in the Result property.

Example

To split a customer records DataTable into smaller batches for processing:

1. Provide a populated customer DataTable containing 100 rows.
2. Add the SplitDataTable activity to the workflow.
3. Set the SplitOption property to RowsPerTable.
4. Enter 25 in the RowsPerTable property.
5. Bind a List variable to the OutputDataTables property to store the generated DataTables.
6. Use a ForEach activity to process each output table individually.

During execution, the activity creates four separate DataTable objects containing 25 rows each and returns them through the OutputDataTables output property for further workflow processing.

Share this Doc

Split DataTable

Or copy link

CONTENTS
Robility Chatbot
Robility Assistant
Online