# Sort

## Apply Sort <a href="#apply-sort" id="apply-sort"></a>

To sort the displayed data in the sheet, follow the steps below.

1. Click the header menu of the column you want to sort.
2. Select "Sort Asc" or "Sort Desc" menu item.
3. When sorting is applied, a sort icon (up/down arrow) is displayed next to the display label of the header.

## Fix Sort Setting <a href="#fix-sort" id="fix-sort"></a>

Fixing the sorting of sorted columns allows you to keep the current sort settings even if other columns are sorted.

To fix the sorting, follow the steps below.

1. Click the header menu of the column which has already been sorted.
2. Select "Fix Sort Setting" menu item.
3. Priority number of the sorting and fixed mark (\*) are additionally displayed on the sort icon next to the display label of the header.

When a column sorting is fixed, you can sort on multiple columns by applying a new sort to the other columns. At this time, the newly sorted column will be sorted in the order of priority next to the fixed sort.

## Reset Sort Setting <a href="#reset-sort" id="reset-sort"></a>

To reset sorting of an already sorted column, follow the steps below.

1. Click the header menu of the column which has already been sorted.
2. Select "Reset Sort Setting" menu item.
3. The sort icon next to the display label of the header disappears and the sort condition is removed. If there are multiple sorted columns, new priorities are assigned and sorting is executed in order of priority.

## Target Records for Sorting <a href="#sort-target-records" id="sort-target-records"></a>

If the sorting columns are [field columns](/mashmatrix-sheet/functions_about_displaying_data/add_column.md#add-field-column) added from Salesforce fields (including field columns from Salesforce formula fields), and all of these fields support filtering on the Salesforce platform, the sort will be applied to the entire records stored in the Salesforce object.

On the other hand, if the sorting columns contain field columns whose fields do not support filtering on the Salesforce platform (e.g., long text area field) or formula columns in the sheet, the sort will only be applied to the records retrieved from Salesforce.

Therefore, if the sheet is set to fetch a small number of records, the data displayed in the sheet after the application of the sort may differ from the actual order (a warning will be displayed in the footer of the sheet).

To increase the number of records to fetch, [change the "Max Fetch Record Num" setting from sheet setting.](/mashmatrix-sheet/functions_about_books_sheets/change_sheet_setting.md#options)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mashmatrix.com/mashmatrix-sheet/functions_about_displaying_data/sort.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
