Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Sort choice not working

(0) ShareShare
ReportReport
Posted on by 318

I would like to be able to SORT my columns that have the choices/dropdown type fields but I am having an issue below.

 

WITHOUT SORT FILTER :

genarich_3-1637210951298.png

 

WITH SORT :  (ISSUE)

genarich_1-1637210884836.pnggenarich_4-1637211047194.png

 

 

Currently, I have it in the Items property that when the user clicks on the Sort icon- the Switch function below will trigger and fire off the correct sorting sequence. I have sorted other fields as well that involved normal text fields using SortByColumns function. These two were combined in one chunk of code in the Items property. 

Switch( 
"OrderStatus",
 Sort(
 Search(
 Filter(
 col_YQQ,
 If(
 Gallery1.Selected.Filter = "ALL OPEN ORDERS",
 Status.Value <> "Completed",
 If(
 Gallery1.Selected.Filter = "NOT STARTED/ BLOCKED",
 Status.Value = "Not started" || Status.Value = "Blocked",
 If(
 Gallery1.Selected.Filter = "NO/ SHORT STOCK",
 Status.Value <> "Completed" || 'In Stock?'.Value = Blank()),
 If(
 Gallery1.Selected.Filter = "EDD UNKNOWN",
 Status.Value <> "Completed" && IsBlank(EDD),
 If(
 Gallery1.Selected.Filter = "EDD THIS MONTH",
 Status.Value <> "Completed" && Month(EDD) = Month(Now()),
 (Status.Value = "Ready for pick up" || Status.Value = "Partially completed")
 )
 )
 )
 )
 )
 ),
 TextInput12_5.Text,
 "Part_x0023_Requested",
 "Part_x0020__x0020_Description_x0",
 "ReasonforRequest",
 "Sales_x0020_order",
 "Owner",
 "PurchaseOrder",
 "Tracking_x0020_ref",
 "ReasonfornoEDD",
 "Issued_x0020_to",
 "RequestedBy",
 "Notes"
 ),
 "OrderStatus",
 If(
 varSortDirection = Ascending,
 Ascending,
 Descending
 )
 )

 

Icon property of image-icon.

If(
 varSortColumn <> "OrderStatus",
 Icon.Sort,
 If(
 varSortDirection = Ascending,
 Icon.ArrowUp,
 Icon.ArrowDown
 )
)

 

 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard