Skip to main content
Community site session details

Community site session details

Session Id : iUL++4KCvLSSvgJC1kzp3u
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

  • TimmyBoy Profile Picture
    997 on 04 Jan 2023 at 04:58:08
    Re: Get last added record into gallery?

    Hello @v-qiaqi-msft 

    Cool ,thanks

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

     

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

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!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete