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

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,299)