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 / Handling time calculat...
Power Apps
Answered

Handling time calculations in an App

(0) ShareShare
ReportReport
Posted on by 105

Hello, I am planning on building out an app that would act like a timesheet but also tracks other details for deliveries to a client with a sign off functionality.

One of the functions I want to add is being able to track the individual deliveries in a day. For each delivery there should be an arrival time and a departure time. The arrival time of the first job and departure time of the last job are the Start time and end time of the entire day.

 

So for example these entries would be done by manual input and there could up to 15-20 deliveries in a day:

Job 1: arrive at 8:00AM Depart at 12:00PM

Job 2: arrive at 1230PM Depart at 430PM

 

The final output for the day would be auto calculated based on the job entries.

Days start time 8AM and end time is 430PM with the total hours being 8.5 hours.

 

Would anyone be able to point me in the direction of the right resources that would help as I am struggling with what components to use to capture the time entries and how to create the sharepoint columns and then do the automatic calculations.

 

Any help or advise would be greatly appreciated.

 

Categories:
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @RogerCP66 ,

     

    Please try:

    With(
     {Temp:
     "Job 1: arrive at 8:00AM Depart at 12:00PM
     Job 2: arrive at 12:30PM Depart at 4:30PM"
     },
     With(
     {
     Start:Min(ForAll(MatchAll(Temp,"arrive at \d?\d:\d\d[A,P]M"),DateTimeValue(Match(FullMatch,"\d?\d:\d\d[A,P]M").FullMatch)),Value),
     End:Max(ForAll(MatchAll(Temp,"Depart at \d?\d:\d\d[A,P]M"),DateTimeValue(Match(FullMatch,"\d?\d:\d\d[A,P]M").FullMatch)),Value)
     },
     $"Days start time {Text(Start,DateTimeFormat.ShortTime)} and end time is {Text(End,DateTimeFormat.ShortTime)} with the total hours being {DateDiff(Start,End,TimeUnit.Minutes)/60} hours."
     )
    )
    

    vbofengmsft_0-1681873028848.png

     

    Best Regards,

    Bof

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard