Skip to content

Sort Action: sort

The sort command allows you to organize data within a specified column on an Excel sheet in ascending or descending order. This is especially useful for structuring and analyzing data in sheets effectively.

Note: Ensure that the file being used is not open during the execution of the Case to avoid errors or conflicts.

Example: You need to sort sales data in the SalesData.xlsx file by the Amount column on the first sheet in descending order.

Steps to Configure:

  1. Add a new step.
  2. Select SET from the Action dropdown.
  3. Enter a variable name in the Element Key field (e.g., SortedData). This variable will store the sorted file path.
  4. Click on Form, select Functions, and choose EXCEL Handler Functions from the dropdown.
  5. In the action field, select sort and provide the following parameters:
    • fPath: Enter the full path of the Excel file to be sorted (e.g., C:\Reports\SalesData.xlsx).
    • columnName: Specify the column in the sheet to sort (e.g., Amount).
    • Sheet: Enter the sheet number containing the data to sort (e.g., 1).
    • sheetName: Specify the name of the sheet containing the data (e.g., SalesReport).
    • orderBy: Choose the sorting order: asc for ascending or des for descending.
  6. Click Save.
v7_excel_file_op_sort_list_view
List View
v7_excel_file_op_sort_grid_view
Grid View

Outcome on execution:

  • The command sorts the Amount column in the sheet named SalesReport within SalesData.xlsx in descending order.
  • The data is stored in the variable defined in the Element Key field for use in subsequent steps.
  • This variable can be referenced in subsequent steps of the automation process using the syntax ${VariableName} (e.g., ${SortedData}).

Last updated: Oct 7, 2025
Back To Top