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

Punch clock for multiple type of jobs

I'd like to create an app that shows the current time, a dropdown list of users to choose from, a dropdown list of job types, a "punch in", and a "punch out". 

I have a user table and a job type table. I also created a sharepoint list to record these entries. Any attempts of finding forum messages related to this kind of question are all private and I have no access. 


Is this possible? Is it possible to add a condition where you cant punch out without a punch in entry?

Any help would be greatly appreciated, thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Punch clock for multiple type of jobs

@001 

I would consider designing a single button to punch and punch out.  When the user is punched in the text on the button says "Punch Out" and when the user is punched out the button says "Punch In".  The text that displays on the button if controlled by the button's Text property.  How the button behaves when it pressed is controlled by the OnSelect property.  In each of those properties you could write a conditional statement that looks something like this.

 

Text Property of the button

 

If(user.status="punched-in","punch out", "punch in")

 

OnSelect Property of the button

 

If(user.status="punched-in",
some_code_to_log_currentday_punchout_time,
some_code_to_log_currentday_punchin_time)

 

My recommendation is to start building out your app and then come back with specific problems you are having.  A punch system is definitely doable.  Let me know if my post was helpful.

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

9 REPLIES 9
Super User
Super User

Re: Punch clock for multiple type of jobs

@001 

I would consider designing a single button to punch and punch out.  When the user is punched in the text on the button says "Punch Out" and when the user is punched out the button says "Punch In".  The text that displays on the button if controlled by the button's Text property.  How the button behaves when it pressed is controlled by the OnSelect property.  In each of those properties you could write a conditional statement that looks something like this.

 

Text Property of the button

 

If(user.status="punched-in","punch out", "punch in")

 

OnSelect Property of the button

 

If(user.status="punched-in",
some_code_to_log_currentday_punchout_time,
some_code_to_log_currentday_punchin_time)

 

My recommendation is to start building out your app and then come back with specific problems you are having.  A punch system is definitely doable.  Let me know if my post was helpful.

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

001
Level: Powered On

Re: Punch clock for multiple type of jobs

@mdevaney 

 

First off thank you so much for pointing in the right direction. Second, I had another question about this job type timesheet app. 

If I create a column of barcode ID's for my user table, can I use that? For example instead of having a punch in button, all they do is select their job and scan their ID?

 

Once again thank you

Super User
Super User

Re: Punch clock for multiple type of jobs

@001
Yes, that’s possible. What industry are you in? I was in Manufacturing and we barcoded the item we were producing instead of the person. That way the person could stay logged in and not have to scan multiple times in the same day. Of course, in that environment employees stayed at their workstation.

Here’s a video you should watch if you’ve never worked with barcodes in PowerApps before: https://youtu.be/60ondObDBH0
001
Level: Powered On

Re: Punch clock for multiple type of jobs

@mdevaney 

 

Yup, same Industry, but a different environment. We have users that might do multiple jobs any given day. 

I'm very new to creating powerapps. I'd like to create a clock field, a job type selection field, and a input text field that will be used to scan barcode ID. 

So I really need to do is create a "timesheet" list in sharepoint that will record the entries from the app? 

Super User
Super User

Re: Punch clock for multiple type of jobs

@001 

Pretty much, creating a "Timesheet" list in Sharepoint would be the 1st step.  At it's most basic you'd only need 4 columns:

 

  • EmployeeID: A single text column
  • JobID: A single text column
  • PunchInOut: A choices column with the options In & Out
  • DateTimeStamp: A date time column

 

A time-punch clock sounds like a good project to learn more about PowerApps.  In my opinion the trickiest part will be scanning the barcode.  I don't know much about how to use the Camera feature yet but maybe you are further ahead in this area!

 

001
Level: Powered On

Re: Punch clock for multiple type of jobs

@mdevaney 

 

So I pretty much had the same as you when it came to creating a timesheet list. 

On the app I've added a clock to show real time and a dropdown list to choose job type thats connected through a job type table.

 

Will I have to connect the job type table to the sharepoint list, so entries could be recorded properly? Same goes for the EmployeeID table. A text box will be created to input a barcode ID using a USB RF scanner, which should function the same as a USB keyboard


In the text box can I use the OnSelect property to tell the app to log the entry when something is entered into the text box? 

 

Super User
Super User

Re: Punch clock for multiple type of jobs


Will I have to connect the job type table to the sharepoint list, so entries could be recorded properly? Same goes for the EmployeeID table. A text box will be created to input a barcode ID using a USB RF scanner, which should function the same as a USB keyboard

 

To record the entries you'll have to create a connection to the Sharepoint list.  You can either set these 2 columns up as a single-line text or a Choices column based on your requirements.

 

In the text box can I use the OnSelect property to tell the app to log the entry when something is entered into the text box? 


 

I think you'd want to use the OnChange property instead of OnSelect.

001
Level: Powered On

Re: Punch clock for multiple type of jobs

@mdevaney 

 

I gotta say you rock! 

 

I've connected appropriate tables and I have created my app, now I just need to collect and patch entries to my list. 

 

onChange =

Collect(LogTimes, {Date/Time: RealTimeClock.text, PunchInOut: PunchLog.text, BarcodeID: ScanId.text}),

ForAll(LogTimes, Patch(SharePoint_ListName, Defaults(SharePoint_ListName), { Date/Time: Date/Time, PunchInOut: PunchInOut, BarcodeID: BarcodeID})

 Am I right to assume I can use the onChange to collect data and patch the collection to my sharepoint list? 

Super User
Super User

Re: Punch clock for multiple type of jobs

@001 

Yes, PowerApps are typically designed to update the datasource via the OnChange or the OnSuccess property of a control.  I still need to learn Patch for myself so I can't really comment on the code you've used but what you are doing does make good sense.

Helpful resources

Announcements
thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (3,574)