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 / Show Only Last item cr...
Power Apps
Answered

Show Only Last item created by the user

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello people,

 

I have this scenario , i want in a gallery just show the last item based on this filter, should show the last item createn by the user and  the status should be = "Finalizada" , i have the filter below created but i dont know how can i do for show just the last item.

 

SortByColumns(Filter(SolicitudDeViajes; EstadoSolViaje="FINALIZADA"; NombresApellidos.Email = User().Email; StartsWith(Title; TextSearchBox1_1.Text)); "Created"; If(SortDescending1;Ascending;Descending))

Categories:
I have the same question (0)
  • Verified answer
    Anchov Profile Picture
    1,986 on at

    you should be able to just surround your filter with either First() or Last(), depending on your sort order.

     

    First(SortByColumns(Filter(SolicitudDeViajes; EstadoSolViaje="FINALIZADA"; NombresApellidos.Email = User().Email; StartsWith(Title; TextSearchBox1_1.Text)); "Created"; If(SortDescending1;Ascending;Descending)))

     

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Anonymous,

     

    Does the 'NombresApellidos' condition make sure you only show the records of that / created by that user? If so, you could always sort the created in descending order and enclose the code in a First() function to only receive the most recently created record:

     

    First(
     SortByColumns(
     Filter(
     SolicitudDeViajes; 
     EstadoSolViaje="FINALIZADA"; 
     NombresApellidos.Email = User().Email; 
     StartsWith(Title; TextSearchBox1_1.Text)
     ); 
     "Created"; 
     Descending
     )
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks! 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks that works but i use Last... thank u

  • adedapo Profile Picture
    256 on at

    You should use First and sort by Created in descending mode. This is because First and Last themselves are not delegable to SharePoint in particular. But Sort and SortByColumns are; so the data source will help you sort across the whole data set and then just return the first item (which because of the sorting, it's the last item).

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,033

#2
Valantis Profile Picture

Valantis 632

#3
11manish Profile Picture

11manish 607

Last 30 days Overall leaderboard