Hi, I want to sort a gallery items by time Ascending or Descending (Date_Time column in Sharepoint List). Pls help me.
Ex: 26/12/2021 14:00
26/12/2021 08:30
26/12/2021 11:00
26/12/2021 09:15
Hi @BuiDucNghia ,
Put a button on the screen with
UpdateContext({varSortOrder:!varSortOrder})
then your gallery Items
Sort(
YouSPListName,
YourDateTimeField,
If(
varSortOrder,
Descending,
Ascending
)
)
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.
Visit my blog Practical Power Apps
Thanks @WarrenBelz
I want to sort a gallery by time the same day as pic attachment.
I have not addressed your If logic as it is not clear to me, but for the rest if you want to sort by Time on the date selected
If(
IsBlank(colSelectedDate), //if gallery not select, filter Gallery is Today
SortByColumns(
Filter(
AddColumns(
colLichTuan,
"TimeSort",
Text(ThoiGian,"hh:mm")
),
txtSearchLichTuan.Text in Text(ThoiGian,"dd/mm/yyyy) ||
Text(ThoiGian,"dd/mm/yyyy") = Text(Today(),"dd/mm/yyyy")
),
"TimeSort",
If(
varSortOrder,
Descending,
Ascending
)
),
WeekdayGallery_1.Selected.LichHop_grp
)
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.
Visit my blog Practical Power Apps
Thanks for your help, but still not work 😞
"Not work" does not really help me - are you getting any errors - if so what are they.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
177 | |
52 | |
41 | |
36 | |
27 |
User | Count |
---|---|
240 | |
81 | |
71 | |
69 | |
66 |