I have a powerapp connected to a sharepoint list with several different column types (choice, date, text, etc.). I am using the modern table control with some simple filters I built for the users. The sort feature on the columns in the table doesn't seem to be working at all. No matter which field I try on, it doesn't sort the table. Is anyone else experiencing this?
Side question - Can you lock the size of the columns in the modern table? Everytime I open my app they are 0 width.
Hi @Timmo1016,
If you’re using the legacy table, consider using other controls (like buttons) to trigger sorting actions manually.
When using the legacy table control in Power Apps, you can create custom sorting buttons to allow users to manually trigger sorting actions. Here’s an example of how you might set this up:
Create Custom Buttons:
Add a button control (e.g., a Rectangle or Icon) to your screen.
Set the button’s label or icon to indicate sorting (e.g., an up/down arrow).
You can use the OnSelect property of the button to define the sorting logic.
Sorting Logic:
In the button’s OnSelect property, write code to sort your data source based on a specific column.
For ascending order, you might use something like:
Sort(MyDataSource, ColumnName, Ascending)
For descending order:
Sort(MyDataSource, ColumnName, Descending)
Apply Sorting to the Table:
When the user clicks the button, it triggers the sorting action.
You’ll need to handle the sorting for each column separately by associating the button with the appropriate column.
Visual Feedback:
Consider changing the button’s appearance (color, opacity, etc.) to provide visual feedback when sorting is applied.
Thank you for your reply. I figured it was just not supported yet. You mentioned that you can sort directly from table headers with the legacy table control. Do you know how I configure that? I don't see any 'Allow Sorting' property for the legacy table control.
Hi @Timmo1016
Sorting:
Sort
or SortByColumns
within your app to achieve basic sorting functionality. However, this approach might require more coding and may not be as user-friendly as sorting directly on the headers.Column Size:
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
WarrenBelz
106
Most Valuable Professional
MS.Ragavendar
73
stampcoin
52