Get Data Row
Get Data Row
Section titled “Get Data Row”Type: get-row · Package: DataTable Activities v1.0.5 · Output: DataRow
Returns the row (DataRow) at a specific position of a DataTable.
How it works
Section titled “How it works”Reads the row at position index (the first one is 0) and returns it. If the index is out of range, it fails with a clear message stating how many rows the table has. It does not modify the table.
With the row you can read cells with Get Cell or modify it with Set Cell / Update Data Row — remember that the row stays linked to its table, so modifying it changes the table.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
table | DataTable | — | The DataTable to read from, e.g. customers. |
index | int | — | Row position, counting from 0. It must be between 0 and the number of rows minus 1. |
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”Returns the DataRow at that position (the table’s own row, not a copy).
Common errors
Section titled “Common errors”| Message | Cause 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 (for example, a text). |
Row index … is out of range (the table has … rows). | The index is negative or greater than or equal to the number of rows; it also happens with an empty table. Check first with rowCount(table) > 0. |
Example
Section titled “Example”Get Data Row table = people index = 0 → output: first
Set Cell row = first column = "age" value = 99Log message = "Name: " + str(first["name"])Related activities
Section titled “Related activities”- Get Cell — read a cell of the row.
- For Each — loop through all rows.
- Find Data Row — get a row by condition instead of by index.