web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details
Power Apps - Building Power Apps
Answered

Get last added record into gallery?

Like (0) ShareShare
ReportReport
Posted on 4 Jan 2023 04:30:54 by 997

Hello,

How can i get the 2 last added items into the gallery?

Sort(Filter(ExpensesCollect,PlanTitle = Text(CurrentBudgetItem)

)

,'Id (ID)',Descending)

This code gives me all the records.

Thank you

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on 04 Jan 2023 at 04:47:27
    Re: Get last added record into gallery?

    Hi @TimmyBoy,

    Do you want the Gallery only display the last two records?

     

    If so, I think you could use the Modified column that records the latest modified date time for each item.

    FirstN(Sort(Filter(ExpensesCollect,PlanTitle = Text(CurrentBudgetItem)
    
    )
    
    ,Modified,Descending),2)

    Or you could use the ID column as the sort column:

    FirstN(Sort(Filter(ExpensesCollect,PlanTitle = Text(CurrentBudgetItem)
    
    )
    
    ,'Id (ID)',Descending),2)​

     

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete