0

I have a gallery that is connected to SharePoint list, the gallery has the following formula for the items: -

Switch(DashBoarSortBy.Selected.Value,



"Network",
SortByColumns(Filter('Work Orders',
('Work Order Status'.Value = "Assigned" Or 'Work Order Status'.Value="New") And
((Created >= colSelectedDateCreated And Created <= colSelectedDateCreated2 ) Or IsBlank(colSelectedDateCreated)) And
(('Start Date.' >= colSelectedDateStartDate And 'Start Date.' <= colSelectedDateStartDate2  ) Or IsBlank(colSelectedDateStartDate)) And
(('End Date.' >= colSelectedDateEndDate And 'End Date.' < colSelectedDateEndDate2  ) Or IsBlank(colSelectedDateEndDate)) And
(Street = colSelectedStreetName Or IsBlank(colSelectedStreetName)) And
(Direction = colSelectedDirectionName Or IsBlank(colSelectedDirectionName)) And
('Location Name' = colSelectedLocationName Or IsBlank(colSelectedLocationName)) And
('Work Order Type'.Value = colSelectedTypeName Or IsBlank(colSelectedTypeName)) And
('Technician Name'.Email = colSelectedTechnicianName Or IsBlank(colSelectedTechnicianName) Or 'Work Order Type'.Value ="Posting"
Or 'Work Order Type'.Value ="UnPosting" Or 'Work Order Type'.Value ="Campaigns Photos" ) And
(Brand = colSelectedBrandName Or IsBlank(colSelectedBrandName)) And
('Work Order Status'.Value = colSelectedTStatusName Or IsBlank(colSelectedTStatusName))
),"NetworkName",SortOrder.Ascending,"SequenceNumber",SortOrder.Ascending),
"Created",
SortByColumns(Filter('Work Orders',
('Work Order Status'.Value = "Assigned" Or 'Work Order Status'.Value="New") And
((Created >= colSelectedDateCreated And Created <= colSelectedDateCreated2 ) Or IsBlank(colSelectedDateCreated)) And
(('Start Date.' >= colSelectedDateStartDate And 'Start Date.' <= colSelectedDateStartDate2  ) Or IsBlank(colSelectedDateStartDate)) And
(('End Date.' >= colSelectedDateEndDate And 'End Date.' < colSelectedDateEndDate2  ) Or IsBlank(colSelectedDateEndDate)) And
(Street = colSelectedStreetName Or IsBlank(colSelectedStreetName)) And
(Direction = colSelectedDirectionName Or IsBlank(colSelectedDirectionName)) And
('Location Name' = colSelectedLocationName Or IsBlank(colSelectedLocationName)) And
('Work Order Type'.Value = colSelectedTypeName Or IsBlank(colSelectedTypeName)) And
('Technician Name'.Email = colSelectedTechnicianName Or IsBlank(colSelectedTechnicianName) Or 'Work Order Type'.Value ="Posting"
Or 'Work Order Type'.Value ="UnPosting" Or 'Work Order Type'.Value ="Campaigns Photos" ) And
(Brand = colSelectedBrandName Or IsBlank(colSelectedBrandName)) And
('Work Order Status'.Value = colSelectedTStatusName Or IsBlank(colSelectedTStatusName))
),"Created",SortOrder.Descending),
"SequenceNumber",
SortByColumns(Filter('Work Orders',
('Work Order Status'.Value = "Assigned" Or 'Work Order Status'.Value="New") And
((Created >= colSelectedDateCreated And Created <= colSelectedDateCreated2 ) Or IsBlank(colSelectedDateCreated)) And
(('Start Date.' >= colSelectedDateStartDate And 'Start Date.' <= colSelectedDateStartDate2  ) Or IsBlank(colSelectedDateStartDate)) And
(('End Date.' >= colSelectedDateEndDate And 'End Date.' < colSelectedDateEndDate2  ) Or IsBlank(colSelectedDateEndDate)) And
(Street = colSelectedStreetName Or IsBlank(colSelectedStreetName)) And
(Direction = colSelectedDirectionName Or IsBlank(colSelectedDirectionName)) And
('Location Name' = colSelectedLocationName Or IsBlank(colSelectedLocationName)) And
('Work Order Type'.Value = colSelectedTypeName Or IsBlank(colSelectedTypeName)) And
('Technician Name'.Email = colSelectedTechnicianName Or IsBlank(colSelectedTechnicianName) Or 'Work Order Type'.Value ="Posting"
Or 'Work Order Type'.Value ="UnPosting" Or 'Work Order Type'.Value ="Campaigns Photos" ) And
(Brand = colSelectedBrandName Or IsBlank(colSelectedBrandName)) And
('Work Order Status'.Value = colSelectedTStatusName Or IsBlank(colSelectedTStatusName))
),"SequenceNumber",SortOrder.Ascending,"NetworkName",SortOrder.Ascending))

now the sort will only work if I select "Created", while SequenceNumber or "NetworkName" will not show any data.. this problem start to happen when the "Work Order" list exceeds 5,000 items. although the Created + Sequenceumber + Networkame are added as indexes inside the list.. now if I remove the second sort field this will work for all the options.. so why I can not do multiple sorts for the gallery items, even if those fields are been indexed?

here are the indexes:-

enter image description here

Thanks

1 Answer 1

1

Although it's not directly related, it seems IsBlank() function is not a supported delegable to SharePoint. Could you replace it with Blank() and try it again?

For more info, please refer to MS Article

Also, at Power Apps SharePoint Delegation

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.