sort_data
Sort rows in an Excel worksheet by one or more columns, in ascending or descending order, and write the sorted result back to the original sheet, optionally using a header row.
Instructions
Sort worksheet rows by one or more columns and write back the result.
Args:
file_path: Workbook path.
sheet_name: Worksheet to sort.
sort_by: List of sort descriptors, each with 'column' (str) and optional 'ascending' (bool, default True).
column: Convenience single-column sort (deprecated in favour of sort_by).
ascending: Boolean default sort order when column is used.
has_header: Whether the sheet has a header row.
Returns: str: Result message.
Notes: - Destructive: overwrites sheet rows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| column | No | ||
| sort_by | No | ||
| ascending | No | ||
| file_path | Yes | ||
| has_header | No | ||
| sheet_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |