Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article helps solve an issue where you can't use sorting or sorting doesn't work correctly in a model-driven app in Microsoft Power Apps.
Scenario 1: None of the columns are sortable in the grid
Resolution
Sorting not available on all the columns is a strong indication that sorting is disabled on the grid control. Use the Power Apps Monitor tool to make sure the enableSorting
grid property is set to true
.
If sorting isn't enabled, update the respective grid property value.
Scenario 2: Sorting doesn't seem to be correct after navigating to the grid or subgrid
Resolution
If there's no custom code that alters the sorting, the default sorting should correspond to the Sort by setting in the current view.
Make sure the view setting is set correctly and all the changes are saved and published.
Scenario 3: Certain columns aren't sortable in grid. Respective column header menu options are missing or disabled
Resolution
The most common reason why a certain field isn't sortable is that Dataverse doesn't support sorting on the underlying field type. Use the Power Apps tool to ensure the sorting isn't disabled by Dataverse.
If sorting is disabled ("disableSorting": true
), this is a strong indication that the sorting isn't permitted on the data field (column). For more information about sortable columns, see Types of columns.
Scenario 4: Column is sortable but the data isn't ordered correctly
Troubleshooting step
Ensure the column is in the expected format (see the
dataType
andFormat
attributes in the image of scenario 3).Note
Data sorting is always performed based on the column type and format rather than the actual data. For example, sorting is always "alphabetical" on text type columns, even if all the data in these fields is numeric.
Check if the data is sorted (ordered) by more than one column. The presence of sorting icons on more than one column indicates multi-column sorting. In this case, the data sorting is performed on the first sorted column (which is not necessarily the leftmost column) and then on the second column. As shown in the following example, the data is sorted first by the Full Name column ascending and then by the Company Name column descending.
The multi-column sorting can be removed by reapplying the sorting on a column (without holding the Shift key down) or by refreshing the app.
The data ordering might be affected by data customizers.
Note
Sorting (data ordering) is always applied to raw data, not enhanced data. A typical example is the case where raw numeric data is replaced by a user-friendly text, in which case the ordering is performed by the numeric data.