web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sort Column by date us...
Power Apps
Answered

Sort Column by date using the dates that is to be stripped from value in first column eg. Value data = STR-Joe-Bloggs23-03-2023

(0) ShareShare
ReportReport
Posted on by 32

Hi,

First Column data is in this format: 

STR-Joe-Bloggs23-03-2023

STR-Nigel-Lovelace28-03-2023

I want to sort the column by date by stripping the date from end of value eg from Nigel's record I want the date at end  28-03-2023

 as a variable and sort the columns records by date. I cant do this easy as the column is not a proper date field or string, it combined with the name. (Done Before my time)

 

Any Help Apricated.

John

Categories:
I have the same question (0)
  • Verified answer
    CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @John777 ,

    Actually you can add a column with the last 10 chars of the string and convert it to date value.

     

    ClearCollect(
     test,
     Sort(
     AddColumns(
     yourDataSource,
     "Date",
     DateValue(Right(Value,10),"DE")
     ),
     Date,
     SortOrder.Ascending
     )
    )

     

    I noticed that the your date has an "European" similar format so I choose for date German date format representation.

    Please note that this formula cannot be delegated on server side to be executed and the data resulted will be subject of powerapps limits (no more than 500-2000 items).

    Hope it helps !

  • Verified answer
    John777 Profile Picture
    32 on at

    Thanks so much for your advice. Below is the the code on gallery search. As I am not familiar with PowerApps, I need to modify it to accommodate your suggestion but not sure how. Can you help modify that code.

     

    SortByColumns(Filter('NDIA Service Request', StartsWith(Participant_x0020_Last_x0020_Nam, SearchBox1.Text)), "Participant_x0020_Last_x0020_Nam", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

  • Verified answer
    CU-18081211-6 Profile Picture
    9,272 Moderator on at

     

    I wasn't sure how you want to sort the result by Date or by Participant Last Name, so I preferred Date:

    With(
     {
     dataSource:
     Filter('NDIA Service Request', StartsWith(Participant_x0020_Last_x0020_Nam, 
     SearchBox1.Text))
     },
     SortByColumns(
     AddColumns(
     dataSource,
     "Date",
     DateValue(Right(Value,10),"DE")
     ),
     "Date",
     If(SortDescending1, SortOrder.Descending, SortOrder.Ascending),
     "Participant_x0020_Last_x0020_Nam",
     SortOrder.Ascending 
     )
    )

    Hope it helps !

     

  • Verified answer
    John777 Profile Picture
    32 on at

    Thanks' greatly for your input and fast reply. I will try this out today. 🙂

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard