cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SandraAkujobi
Post Partisan
Post Partisan

Creating Time Sheet form on Power Apps

I am trying to customise a time sheet form on power apps using the fields from my SharePoint list. Is it possible to create a form where an employee can clock in once but can later come back in to add in several activities they've performed within the day without having to clock in again. Also would it mean creating more than one form for one list?

1 ACCEPTED SOLUTION

Accepted Solutions

Here is a small example of the structure I'm talking about.

2020-02-17 08_23_14-Untitled Diagram.drawio - draw.io.png

On your App's OnStart function, you can generate a sessionID using Today() to get the date which they are clocking in/out and doing their activities. I've used GUID() in the past, but I think Today() will make more sense here.

You can do a LookUp(Timeclock, And(SessionID = Today(),Action="In"),Action) to see if they have already clocked in today. If so, disable a clock in button and enable a clock out button. If they have not, do the opposite.

To enter activities, just use Collect() to insert a new row into the Activity List using the Today() sessionID, give an activity name and note (this can be used for production tracking, breaks, overtime, etc..).

Similarly, you will use Collect() to add a clock in/out.

Clock In
Collect(Timeclock,{SessionID:Today(),EmployeeName:Office365Users.MyProfileV2().displayName,EmployeeEmail:User().Email,Timestamp:Now(),Action:"In"})

Clock Out
Collect(Timeclock,{SessionID:Today(),EmployeeName:Office365Users.MyProfileV2().displayName,EmployeeEmail:User().Email,Timestamp:Now(),Action:"Out"})

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

 

View solution in original post

10 REPLIES 10
EricLott
Resident Rockstar
Resident Rockstar

Yes, this is possible. You would have one list of time clock ins/outs that they can clock in to, then a list of activities that they can write to. You would need a clock in/out screen and a screen for adding entries to the other list.

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

mdevaney
Super User
Super User

@SandraAkujobi
I’m sure it can be done. Whether or not you need multiple lists depends entirely on what the app does.

Can you please explain what data will be collected from the user at each step? Walk us through the process and show some sample data.

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

@mdevaney  basically the data collected by the user would be the time they clocked in and out, the activities they've done for the day, so the duration of each activities, a user can have multiple activities for the day. Another thing they would need to put in is their complete work hour for the day, break hour, travel time and overtime.  By the end of the every week data they've provided are collected into one and sent to their respective manager to be approved. 

The images below show the process of how it would look like once information have been collected from users.

 

so this is how it looks when grouped by employee and start timeso this is how it looks when grouped by employee and start timeSo when an individual is clicked on  it shows the activity they've put in for the daySo when an individual is clicked on it shows the activity they've put in for the daythese are the two activities done by this userthese are the two activities done by this user

 I've also created a timesheet entries list for when the week is completed their timesheet for the week could be stored and sent for approvals but when I tried to do that just one activity was added in excluding the other inputs for the day and the week. Which is why I'm asking whether I would need to create another list to be able to avoid that issue. 

 

Please let me know if you need anymore information.

 

@EricLottIf I create separate screens for the two how would they connect, would I have to create a lookup field on the activity list?

 

So a clock in/out screen that lets them clock in and then it would navigate then to the activity screen, but what if they want to add in another activity for the day that would mean they would have to sign in again?

 

Yes, you could just do a lookup field to gather the activities for each work period. Do you already have existing Lists set up, or are you starting from scratch?

I'm starting from scratch.

Here is a small example of the structure I'm talking about.

2020-02-17 08_23_14-Untitled Diagram.drawio - draw.io.png

On your App's OnStart function, you can generate a sessionID using Today() to get the date which they are clocking in/out and doing their activities. I've used GUID() in the past, but I think Today() will make more sense here.

You can do a LookUp(Timeclock, And(SessionID = Today(),Action="In"),Action) to see if they have already clocked in today. If so, disable a clock in button and enable a clock out button. If they have not, do the opposite.

To enter activities, just use Collect() to insert a new row into the Activity List using the Today() sessionID, give an activity name and note (this can be used for production tracking, breaks, overtime, etc..).

Similarly, you will use Collect() to add a clock in/out.

Clock In
Collect(Timeclock,{SessionID:Today(),EmployeeName:Office365Users.MyProfileV2().displayName,EmployeeEmail:User().Email,Timestamp:Now(),Action:"In"})

Clock Out
Collect(Timeclock,{SessionID:Today(),EmployeeName:Office365Users.MyProfileV2().displayName,EmployeeEmail:User().Email,Timestamp:Now(),Action:"Out"})

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

 

View solution in original post

EricLott
Resident Rockstar
Resident Rockstar

Another thing, you may want to add a date picker control to override the SessionID with a different date if they need to add activities to previous dates. That would look something like this:

If(DatePicker1.SelectedDate <> SessionID,Set(SessionID,DatePicker1.SelectedDate));
//Do the Collect() to add the activity;
Set(SessionID,Today())

 

@EricLottI've been trying to follow the instructions given on Power Apps but it's quite difficult to follow. 

 

1. Are both timeclock app and activity app combined?

2. The formulas you've given what properties would they be included in?

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,092)