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 / Calculating The Time I...
Power Apps
Unanswered

Calculating The Time In Lieu In Power App

(1) ShareShare
ReportReport
Posted on by 8

Hi Folks,

 

I am developing a power app for time in lieu request. The way it worked it user first make a request by providing start and end date time and other fields. Then flow run and request send to user's Manager for approval. After approval , a dedicated leave balance  added to user record i.e. HH:MM. When user make a another request to take time in lieu, balance will be deducted from user leave balance. This is the working of entire app in short.

 

There is one requirement when user do after hours work i.e. between 11pm to before 6 am , time will be double. For example if user work from 15/07/2024 10:00 PM till 16/07/2024 01:10 AM, then total time he worked 5:20 (HH:MM) (10 PM TO 11 PM = 1 Hour, 11PM to 01:10 AM = 4:20). Thats all i have calculated in Power app On select event of Submit Button. 

 

Now i have below requirements and need input:

STartDateTime: 

End DateTime

1. what if user works on Weekend. Or start from 11 PM Friday till 9 am Saturday. What would be the best approach to figure out  when to add double hours or not on Weekend.

2. Right now, its hard code in my app if user work after 11 pm and before 6 am, i am doubling the time. What if requirement change they want from 10 pm to 3 am. I need to change the app code again.

 

I am looking for some generic solution's where either i create a another list for this rule or something.

 

 

Categories:
I have the same question (0)
  • developingteal Profile Picture
    392 on at

    Where do you want to store this information? You can definitely handle the requirements you have inside of powerapps. You can create conditionals for all the conditions you specified, and set the 'hard coded' version you made to variables in a different place that way it makes it easier to edit. You can't really get around changing the code or some form of it if the requirements change, you can just follow good coding principles by assigning values to variables to make them easier to edit, hence in your scenario when the values change you can just change it in one place rather than everywhere.

  • developingteal Profile Picture
    392 on at
    What's the status of this/ what's the current error?

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard