Skip to main content

Sort Data Table

AutomatR.DefaultActivities.Datatable.SortDataTable

The "Sort Data Table" activity in AutomatR allows you to sort an entire DataTable in either ascending or descending order based on the values of a specified column. This activity streamlines the process of organizing data, providing flexibility in arranging it according to specific requirements.

Properties

NameDescription
Input
Data TableEnter the DataTable variable on which sorting needs to be applied. DataTable variable or argument.
ColumnEnter the name of the column on which the sort operation should be applied in the DataTable. String variable or argument.
DirectionSelect the order of sorting for the DataTable. Choose either "Ascending" or "Descending" from the available options. Enumeration variable or argument.
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 variable or argument containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Sort Data Table" activity. This can be useful for handling synchronization issues. Integer variable or argument containing the delay duration. Example: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.
Output
ResultReturns the DataTable with sorted order based on the specified column and direction. DataTable variable or argument.

How to use:

  1. Drag and drop the "Sort Data Table" activity onto the workflow.
  2. Configure the properties by specifying the DataTable variable, the column on which sorting is to be performed, and the sorting direction.
  3. Optionally, configure the delay and customize the display name.
  4. Execute the workflow to obtain the sorted DataTable based on the specified column and direction.

Example: Consider an example where the "Sort Data Table" activity is used to sort a DataTable named "employeeData" based on the "Salary" column in descending order:

Sort Data Table:
Display Name: "Sort Employee Data"
Data Table: employeeData
Column: "Salary"
Direction: Descending
Result: sortedEmployeeData

In this example, the activity sorts the "employeeData" DataTable based on the "Salary" column in descending order, and the result is stored in the "sortedEmployeeData" DataTable variable for further use in the workflow.