Skip to content

Set Cell

Type: set-cell  ·  Package: DataTable Activities v1.0.5  ·  Output: none

Sets the value of a column in a row (DataRow).

Writes value to the column of the row. The value is converted to the column type (for example, "42" to int). A null or an empty string leaves the cell empty (DBNull). If the column type is object, the value is stored as is.

ParameterTypeDefaultDescription
rowDataRow—The row to modify, e.g. row.
columnstring—Column name (case-insensitive).
valueobject—The value to set (converted to the column type).

None.

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

MessageCause and fix
'row' must evaluate to a DataRow.row is not a row (for example, null because Find Data Row found nothing).
'column' is required.The column name is missing.
Column '…' does not exist. Available columns: ….The column does not exist in the row’s table; the message lists the real ones.
A value is not compatible with the type '…' of column '…'.The value cannot be converted to the column type (e.g. text in an int column). Convert it first or use a column of another type.

Mark each row as processed while looping through the table:

For Each items = orders itemVariable = row
└─ activities:
Set Cell row = row column = "Status" value = "Processed"
Set Cell row = row column = "ProcessedAt" value = now()
Write Excel Sheet path = "C:/out/orders.xlsx" data = orders