Hi everyone,
I'm currently working on a gallery that pulls data from a SharePoint list. The goal is to sort the gallery items so that blank values in the ReqDeadline column are shown first, followed by the rest of the records sorted in descending order by the ReqDeadline date.
Current code:
SortByColumns(
Filter(
'SharePoint List',
// Conditional Plant Filtering
If(
Left(gblUserNickname, 2) = "hu",
Plant = 371,
If(Left(gblUserNickname, 2) = "mx", Plant = 372, true)
),
/* Status Filtering */
(IsBlank(Status_Dropdown_4.Selected.Value) || Status in Status_Dropdown_4.SelectedItems.Value),
/* EquipID Filtering */
(IsBlank(EquipID_dropdown.Selected.Value) || EquipmentID in EquipID_dropdown.SelectedItems.Value),
/* Created Date Filtering (Date) */
(IsBlank(DatePickerSlicer.SelectedDate) || CreatedDate = DatePickerSlicer.SelectedDate),
/* Planner Filtering */
(IsBlank(Planner_Combobox1_1.Selected.Value) || PlannerName in Planner_Combobox1_1.SelectedItems.Value),
/* Exclude Closed ProgressStatus */
ProgressStatus <> "Closed",
/* Exclude Status ending with 0 */
!EndsWith(Status, "0")
),
// Sort by calculated value: blank ReqDeadline = "01/01/3000", then by ReqDeadline descending
If(IsBlank(ReqDeadline), DateValue("01/01/3000"), ReqDeadline), SortOrder.Ascending
)
The Goal:
- Display the records in the gallery where the
ReqDeadline column is blank first.
- After the blank records, show the remaining records sorted in descending order by the
ReqDeadline column.
The Issue:
The formula works correctly with the other columns, but PowerApps doesn't recognize the ReqDeadline column. When I try to reference it (e.g., IsBlank(ReqDeadline) or ReqDeadline directly), I get errors saying that the column is either not valid or it expects a text value, but the column in SharePoint is of type Date.
I've checked that ReqDeadline is the correct display name for the column in SharePoint.