Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

I can't sort a gallery bij a date column.

(0) ShareShare
ReportReport
Posted on by 76

After yor great help earlier I have one more issue which I would like to solve. 
See the pictures below as examples for more info.

In my SPO list I have a lookup column with starting dates of a training. The training is created in another list and in this list I store the people who are attending the list so I need the Start time from the parent list. This works like it should be. 

I even have a filter on the  gallery that work with the date from a datepicker to find the training dates in the futere 

Pic sun2.png

This works but now I would like to sort the gallery on that Date/time Column....... And I tried and tried. more than 2 day now. Thats OK, It rains in the Netherlands so I have time. But it's also annoying that I don't get it done. 
It tried also with this 
SortByColumns(Filter(Sessies; dpFilterCT.SelectedDate <= DateValue(Datum.Value));"datum"; Descending)
but that want work also. 

Maybe, I must work with a collection but as a starter in PowerApps that pretty hard to figure out. 
Here are some more pictures

Pic sun1.pngPic sun2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

Kind regards 
Steven

  • Steven | TIMI365 Profile Picture
    Steven | TIMI365 76 on at
    Re: I can't sort a gallery bij a date column.

    Hi Gabibalaban ,
    Thank you so much. Everything works now. 
    Very happy with you sharing your knowledge 👍

     

    Kind regards 
    Steven

  • CU-18081211-6 Profile Picture
    CU-18081211-6 9,261 on at
    Re: I can't sort a gallery bij a date column.

    @StevenTIMI263 
    put on item property of the form the following formula:

    LookUp(Sessies;ID=galCursistem.Selected.ID)

     

  • Steven | TIMI365 Profile Picture
    Steven | TIMI365 76 on at
    Re: I can't sort a gallery bij a date column.

    Hi Gabibalaban, 
    Thanks for helping. This works. but........ Now the connected form gives me an error massage. I suppose that the something with the " Date" value returns this error. See the screen shot. The field "Hoogwerker" is a fixt field and don't need the selected.item.The other field aren't loading........

    StevenTIMI263_1-1605515663967.png

    StevenTIMI263_2-1605515919765.png

     

    I hope you can help

    regards Steven

     

     

  • Verified answer
    CU-18081211-6 Profile Picture
    CU-18081211-6 9,261 on at
    Re: I can't sort a gallery bij a date column.

    @StevenTIMI263 Can you show me the error please ...

     

    In my formula I wrote DateValue not Value ...😊

    Sort( Filter(AddColumns(Sessies;"Date"; DateValue(Datum.Value)); dpFilterCT.SelectedDate <= Date); Date; Descending)

  • Steven | TIMI365 Profile Picture
    Steven | TIMI365 76 on at
    Re: I can't sort a gallery bij a date column.

    yes Thank you for your help But when I take your solution I don't see any error massage. But It want return any items to my gallery

    StevenTIMI263_2-1605461263352.png

    StevenTIMI263_3-1605461306220.png

     

     

  • CU-18081211-6 Profile Picture
    CU-18081211-6 9,261 on at
    Re: I can't sort a gallery bij a date column.

    @StevenTIMI263  - I used Date in my reply not Datum.Value.

  • Steven | TIMI365 Profile Picture
    Steven | TIMI365 76 on at
    Re: I can't sort a gallery bij a date column.

    Thanks for replying. As you see I have an error massage. I tried "Datum" , Datum.value etc but one way or the other I want work.

    StevenTIMI263_0-1605459377803.png

     

     

  • CU-18081211-6 Profile Picture
    CU-18081211-6 9,261 on at
    Re: I can't sort a gallery bij a date column.

    Hi @StevenTIMI263 ,

     

    If you say that you  don't have more than 100 records in this list, you can you try to move the filter on user-side trying this:

     

    Sort( Filter(AddColumns(Sessies;"Date"; DateValue(Datum.Value)); dpFilterCT.SelectedDate <= Date); Date; Descending)

     

    Hope it helps !

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,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard