cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PaulB1
Level: Powered On

Timesheet APP Question

I have built a timesheet app in PowerApps with SQL Server as the DB to use as lookup and record data from the mobile pront end used by our technicians.

In the app I have used various controls and status to ensure that only today roster can be used. This works very well for the regular day to day rostered time between 04:00 and 18:00. (for example I use a form lookup as: LookUp('[dbo].[PSTSheet]', EmployeeId_1 = Value(TextInput23.Text) && Tjobno = Value(TextInput22.Text) && Text(tdate,"[$-en-US]yyyy-mm-dd") = Text(tdate, "[$-en-US]yyyy-mm-dd")) This returns a status for me to test that the timesheet data has been entered today.

I now find that we are starting to roster some work from around 22:30 to 04:00, which now presents me with a different problem. The company wants this to be one time block however my app tests for today() for the start of the rostered time. The issue become relevant when they go to sign off at 04:00 and SQL SERVER finds no record for today in the table. (based upon the above LOOKUP)

Yes we could roster it in two blocks 22:30 to 23:59 and then 0:00 to 0:400, but technicians are not likely to stop work at 23:59 to finish one roster and start a new roster for the new day. So this is not a preferred option.

I still want to preserve the lookup to ensure that only roster entries within the last 24 hours are checked.

 

Any ideas or thoughts on how to overcome a roster across 2 days would be grateful.

 

Thanks Paul

1 REPLY 1
ZePowerDiver
Level 8

Re: Timesheet APP Question

Paul,

have you considered working with the DateDiff function and base your evaluation on the minutes or hours units ?

depending on your business rules, you may have to do a combination of evals, based on the current time of the day, but if in facts, the real constraint is "within the last 24 hours", then eval just the difference.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,349)