Skip to content

Remove Data Row

Type: remove-row  ·  Package: DataTable Activities v1.0.5  ·  Output: none

Removes a row from a DataTable by its index (zero-based).

Removes the row at position index (the first row is 0). If the index is out of range, it fails with a clear message and the table does not change. The run log states how many rows remain.

ParameterTypeDefaultDescription
tableDataTable—The DataTable to modify, e.g. customers.
indexint—Position of the row to remove, counting from 0. It must be between 0 and the number of rows minus 1.

None.

This activity does not return a value; it modifies the table in place.

MessageCause and fix
'table' must be a DataTable.table does not evaluate to a DataTable.
Row index '…' is not a valid integer.index is not an integer.
Row index … is out of range (the table has … rows).The index is negative or does not exist (also with an empty table). Use rowCount(table) - 1 for the last row.

Remove a repeated header row that a file brings and continue:

Remove Data Row table = people index = 0
Log message = rowCount(people) + " rows left"