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 / Get last added record ...
Power Apps
Answered

Get last added record into gallery?

(0) ShareShare
ReportReport
Posted on 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

Categories:
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    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)​

     

  • TimmyBoy Profile Picture
    997 on at

    Hello @v-qiaqi-msft 

    Cool ,thanks

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard