cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jchandra
Frequent Visitor

display the latest entry

I have data source connected to Ms Excel. 

in the first column, there is a list of Trolley ID :["1","2","3","4","5"]

How to display the latest entry of each trolley ID in the gallery? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @jchandra ,

 

I have made a test for your reference.

 

1. Here is my excel table.

vyujincuimsft_1-1656404693800.png

2. Add a Button Control and apply the following formula on its OnSelect property as:

ForAll(Distinct(datasource,'Trolley ID'),Collect(collectionname,First(Sort(Filter(datasource,Value('Trolley ID')=Value(Result)),'Last Checked Date',Descending))))

3. Select the Gallery Control and set its items property to collectionname.

vyujincuimsft_2-1656405070161.png

 

 

Best Regards,
Charlie Choi

View solution in original post

3 REPLIES 3
rubin_boer
Super User
Super User

hi @jchandra 

 

Last(col).Value will give you the last entry. 

 

e.g. 

consider the the variable x as a table 

Set(x,["1","2","3","4","5"])

Last(x).Value will return 5 

 

Regards,

R

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.
jchandra
Frequent Visitor

for example I have this table where each row is entry input in powerapp.
so I would like to display only the latest entry of each Trolley ID (highlighted in yellow) on the gallery.

Please help if have any idea, thank you..

how to display latest entry.JPG

v-yujincui-msft
Community Support
Community Support

Hi @jchandra ,

 

I have made a test for your reference.

 

1. Here is my excel table.

vyujincuimsft_1-1656404693800.png

2. Add a Button Control and apply the following formula on its OnSelect property as:

ForAll(Distinct(datasource,'Trolley ID'),Collect(collectionname,First(Sort(Filter(datasource,Value('Trolley ID')=Value(Result)),'Last Checked Date',Descending))))

3. Select the Gallery Control and set its items property to collectionname.

vyujincuimsft_2-1656405070161.png

 

 

Best Regards,
Charlie Choi

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,323)