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

Community site session details

Session Id : JBzYM3PMBnJW5hSnVT9kFg
Power Apps - Building Power Apps
Unanswered

Calculating The Time In Lieu In Power App

Like (1) ShareShare
ReportReport
Posted on 15 Jul 2024 07:30:15 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.

 

 

I have the same question (0)
  • developingteal Profile Picture
    392 on 23 Jul 2024 at 17:58:24
    Calculating The Time In Lieu In Power App
    What's the status of this/ what's the current error?
  • developingteal Profile Picture
    392 on 15 Jul 2024 at 15:45:08
    Re: Calculating The Time In Lieu In Power App

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading started
Loading complete