Skip to main content

Add Data Column

AutomatR.DefaultActivities.Datatable.AddDataColumn

The "Add Data Column" activity in AutomatR is part of the DataTable activities package, designed to facilitate the addition of a data column to a specified DataTable. This activity provides flexibility in defining the characteristics of the new column, such as its name, data type, and optional settings like allowing null values, auto-increment, default value, uniqueness, and maximum length.

Properties

NameDescription
Input
ColumnSpecifies a DataColumn object that needs to be added to the existing DataTable. DataColumn variables containing the definition of the column to be added.
Column NameSpecifies the name of the new column to be inserted into the table. String variables containing the desired column name.
Data TableSpecifies the DataTable variable that has extracted data from other inbound activities. DataTable variables containing the target DataTable.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
Allow NullSpecifies whether to allow null values in the new column. Boolean variables determining whether to allow null values.
Auto IncrementSpecifies whether to allow the column to increment automatically when a new row is added. Boolean variables determining whether to enable auto-increment.
Default ValueSpecifies the default value for the new column when creating new rows. String variables containing the default value.
DelaySpecifies the amount of time (in seconds) to wait before executing the "Add Data Column" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.
Max LengthSpecifies the maximum length for each row of the new column. Integer variables containing the maximum length.
UniqueSpecifies whether the values in each row of the new column should be unique. Boolean variables determining whether to enforce uniqueness.

How to use:

  1. Drag and drop the "Add Data Column" activity onto the workflow.
  2. Configure the properties by specifying the DataColumn object, column name, DataTable variable, and other optional settings.
  3. Optionally, configure the delay.
  4. Execute the workflow to add the specified column to the DataTable.

Example: Consider an example where the "Add Data Column" activity is used to add a new column named "Age" to an existing DataTable:

Add Data Column:
Data Table: existingDataTable
Column Name: "Age"
Allow Null: False
Auto Increment: False
Unique: False
Max Length: 3

In this example, the activity adds a new column named "Age" to the "existingDataTable" DataTable, specifying that null values are not allowed, auto-increment is disabled, uniqueness is not enforced, and the maximum length is set to 3 characters for each row.