Hi friends,
I'm writing a canvas app with a SharePoint list back-end.
I've created a dynamic sort within my canvas app that sorts a gallery based on which text label the user clicks.
The function works perfectly - except, when sorting by any of the date columns I've created in my list? The sort function treats each date column as text and therefore does not sort correctly.
The exception to this problem is the "Created" column. The "Created" column sorts as you'd expect however, my "StartDate" date/time column (example format: 1/12/2024) sorts as text?
I can only infer that the Switch statement is transposing the data format cause other non-date column types are also being evaluated in my switch statement.
Set(_varColumn,"Start Date");
//SORT DATA SOURCE BY DYNAMIC VARIABLE VALUE
Sort(
Filter(
'MyDataSource',
Active = 1
),
Switch(
_varColumn,
"Employee",
//THE Employee COLUMN IS A PERSON COLUMN IN THE SHAREPOINT LIST
Employee,
"Start Date",
//THE StartDate COLUMN IS A CUSTOM DATE TIME COLUMN IN THE SHAREPOINT LIST
StartDate,
"Created",
//THE Created COLUMN IS THE DEFAULT COLUMN IN THE SHAREPOINT LIST
Created
),
SortOrder.Ascending
)