Creating a Clock in and Clock Out

Hello,

Im looking to create a Clock in and Out system. I want the system to save and track all times and even add the total time up.

Ive already read this forum post, but dont exactly understand it. Thanks for the help <3
Time tracker, clock in clock out! - Need help - Bubble Forum

Hey @toddpechin12344 ,
Do you have a specific question?
Looks like you’d want to create a Custom Data Type named something like “Time Track”.
Then you’d have custom fields for “Clock In”, “Clock Out”, “Difference”

Then to add them up you could either do a frontend workflow that calculates it for the individual use on the fly, or you could do a backend workflow that crates a new Table.

Alex

I just need assistance setting up the code/workflow for it. I dont exactly know exactly how to set it up to log the time and add the total times.

Got it. Well you could either higher a bubble coach to help walk you through the steps or take some more online bubble lessons.

If you’r having a specific problem that you need help with that’s where the forum can help.

Understood, Is there anyway you can help me setup the proper workflow? I keep getting errors thats really my only issue. The rest I could do myself if I could get the Clock in down.

Ive created a Data type “TimePunch” with Logged in and Logged out field. But when I try and setup the work flow, I cant get it to save the Logged in time.

Update, I got it to log the LoggedIn time, But it doesnt edit the Logged out time, untill I log in again…

What are you determining as “Logged out”? If the user log’s out of his account or if the user leaves the page at all?

You’ll have to have 2 workflows, once that fires off if the User is logged in (to log the user out) and one that fires off if the user is logged out (if the user is logged in)

What I did was added a In/Out field to every user that represents their current status. Then creates an entry if the Current User is logged out, and edits the entry if the current user is logged in.

I want it to register off when the clockin button and clockout button is used. The goal is to be able to view all their Clocked times and add their total times up.

I’m not sure if you’ve ever use QuickBooks Time (Tsheets) but they track everything in terms of Timesheets. So a data type would be Timesheet. With fields like Time in (type date/time) Time out (type date/time). Maybe a notes field (type text). Tsheets also keeps a list of ongoing jobs and tracks location but lets ignore that for now.

Under Users you would add a new field called Timesheets (with the type Timesheet), check the box to make it a list. Now you can store a list of Timesheets under one user, and sheet timesheet has it’s own fields like the notes, time in, time out, etc.

Now in your UI you have to make it work accordingly. Make a “clock in” button inside a group, and make a the group’s type “Timesheet”. The clock in button workflow would be Create a thing... with the type Timesheet. Set the “Clock In” field to Current Date/time then step 2 would be Make changes to a list of things and the thing to change is Current user's Timesheets and change the field Timesheets (the list stored under the user) add Result of Step 1. So now you are taking the timesheet you made in step 1, and adding it to the list of the current user. For step 3 do “Display data in an element” and choose your new group you’ve made, and the data to send is the Result of step 1 So you’re displaying the newly created timesheet data into that group.

For the clock out button the workflow would be Make changes to a thing, paren't group's Timesheet and set the field Clock Out time to Current Date/time

That’s the basic functionally of it pretty much but there’s still a lot of work like cleaning up the UI so the clock in button isn’t visible at the same time as the clock out button, etc. You might need to make new data types like “Pay period” and each time sheet is under a new pay period every week, etc.

I assume its a plugin? I see a few QuickBooks products but nothing with Time/Timesheets

They bought it from Tsheets and renamed it a few years ago, but it’s a service they offer for employers to track employee’s times and locations. It’s an app that employees install on their phone and they login and do the clock in/clock out and request time off, etc.

What you’re doing is basically re-creating that in Bubble it sounds like. Which would be beneficial if you want it to integrate better or want to run it with less cost than Quickbooks Time

In regards to ClockIn and ClockOut, are these list or just single Date/Time?

The ClockIn and ClockOut would be single fields not lists. Everything I proposed was just a quick thought on how to do this but I think it makes sense. Then one user would have a list of timesheets throughout the day. For example clocked in in the morning, clocked out at 12 for lunch, then clocked back in, then clocked out at the end of the day.

One thing I’m already thinking to change is instead of keeping a list of Timesheets under the user, just make a field with the type User under the timesheet. Then on the timesheet creation just set the User field to the Current Logged In User

The clockin works but the clockout button doesnt add to the data.

Okay, I officially broke it now.

:joy: What does the error say when you click on the “1 issue” at the top of the page. Looks like maybe the field is set to a single user not a list.

Also maybe switch away from what I was saying about storing the list under the User. Instead just make a user field under the Timesheet and add the current user to that when you create the timesheet.

This topic was automatically closed after 70 days. New replies are no longer allowed.