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 / Look Up by currently Time
Power Apps
Answered

Look Up by currently Time

(0) ShareShare
ReportReport
Posted on by 13

 

Hello, I need your help.

I'm trying to get a lookup based on a current time.

So:

I have an Excel table with a timetable in it.

So departure times for each train station.

For some train stations there are several departure times.

Something like this: 

Station A 12:15

Station A 13:15

Station A 14:15

Station B 15:15

The station names (Station A or Station B) are in column A "Stations". 

The departure times are in column B Departures. 

So separate from each other. 

If it is currently 11:50 I want to see the departure time from Station A at 12:15. 

If it is currently 13:20 I want to see the departure time from Station A 14:15. 

The current time is in Label4.

This is always displayed up to date using a variable called currentTime and a timer. All values, whether in the timetable or in Label4, are decimal values. So 14:30 = 14.50. Thank you in advance for your help!!!




Categories:
  • Verified answer
    Kirkby Profile Picture
    659 Moderator on at

    Hi @TRR 

     

    13:20 : the earliest next train is 14:15 -  Station A  

     

    confidential_traintime2024-03-14 14 54 59.png

    Timer is updated every second

    confidential_traintime2024-03-14 14 54 59 (2).png

    for demo, put list of next train times into ColRelatedTime.
     
    ClearCollect(ColRelatedTime, SortByColumns(Filter(colTimeTable, TimeValue(DepartureTime) > TimeValue(currentTime)),"DepartureTime", SortOrder.Ascending));
      
    TimeValue is an useful function to compare time values.

    DateValue, TimeValue, and DateTimeValue functions - Power Platform | Microsoft Learn

     

    confidential_traintime2024-03-14 14 54 59 (3).png

     

    Kirkby

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 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard