Sort Table
Sorts a data table based on the values in a specified column.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Table - The input data table to be sorted.
- Column Name - The name of the column to sort by.
Options
- Order Type - Specifies the sort order. Options are:
- Ascending - Sort in ascending order (A-Z, 0-9)
- Descending - Sort in descending order (Z-A, 9-0)
- Output Type - Specifies whether to pass the table by reference or by value. Options are:
- Pass By Reference
- Pass By Value
- Locale - Optional. Specifies the locale to use for sorting string values.
Output
- Table - The resulting sorted data table.
How It Works
The Sort Table node sorts a data table based on the values in a specified column. When executed, the node:
- Validates that the input table is not empty and is valid
- Checks if the table is a reference table and handles it appropriately
- Validates that the column name is not empty
- Converts the data table to a pandas DataFrame
- Sorts the DataFrame based on the specified column and options
- Converts the sorted DataFrame back to the data table format
- Returns the sorted table
Requirements
- A valid input data table
- A valid column name that exists in the table
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid input table
- Empty column name
- Invalid table structure
- Column name does not exist in the table
Usage Notes
- The Output Type option can be set to "Pass By Reference" for handling large tables more efficiently
- The Order Type option determines whether the table is sorted in ascending or descending order
- The Locale option can be used to specify locale-specific sorting rules for string values
- The node sorts the entire table based on the values in the specified column
- All rows in the table maintain their integrity during the sorting process