web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard