Time sheet to log what time started/finished work

Hello, I’m currently struggling to make simple time sheet to record what time workers start/finish work for internal system. What I am intending to make is the time sheet which every workers can record their time by pushing button, and also admins page which administrator can chceck workers condition.

There are 2 problems I am facing.

1, I don’t know what kinda data type I should use to record each workers time, I tried to combine with user data type but I couldn’t create a new thing using user type, so should I make new data type?

2, I don’t know how I can record the time, I tried using create new thing and current date/time but it will create 4 separated data and can’t show 4 diffrent time( start/start break/finish break/finish)



in one data cell.

1 Like

You can create one table with the Following data-

  1. UserID (user type)
  2. Start time (date) -
  3. Start Break (date)
  4. Finish Break (date)
  5. Finish (date)

Thank you for your response! Do you have any idea how I can show these 4 diffrent data in one same row in repeating group??

Why you have created the 4 rows instead of one. For the same day, all details should come in same row.

Yes, I’m aware of it but if I wanted to make them in one, the result became like below, all same time.


Here’s what you’ll need to do, although it might be a little tricky since you have 4 entries instead of 2.

You’re wanting to see all the data on the same line. So for that you’ll need to change your data type just a little bit.

Instead of this:

  1. UserID (user type)
  2. Start time (date) -
  3. Start Break (date)
  4. Finish Break (date)
  5. Finish (date)

Add another date field (I’ll explain)

  1. UserID (user type)
  2. Date (date)
  3. Start time (date) -
  4. Start Break (date)
  5. Finish Break (date)
  6. Finish (date)

The 2nd field (date) will be our reference. The only thing we care about in the 2nd entry (Date), is the actual date. Time isn’t a factor. So to keep all the data in row, how the workflow should be, when a user clocks in, 2 things should happen.

1> We do a search to see if the date they are starting exists in the data file. It’s looking that the 2nd date field. If nothing exists, we create it. Since we are creating it, you’ll want to Create a new Thing, fill in the Date (Ideally change the Hours/Minutes/Seconds to 0), and then add the Start time.

2 > Check to see if the Date(2nd) Exists, if it does, edit it. If it already exists than we know that we don’t need to create a new entry, we just need to edit what we have. And we can edit what we have by determining what’s left using conditions.

So basically, how yours is set up currently, you are creating a new entry every time the action is preformed but you only want 1 entry per day, and just edit that entry throughout the day. That way all the data is consolidated into 1 line.

I have a time management system in my app and this is how I have it structured, however I only do Clock in - Clock Out, and we factor the hours worked between the two. So they usually have 2 entries per day, (In for work, out for break. In from Break, Out from work) SO when they run their reports for the Employee’s, they usually have 2 entries per day.

Hope this helps!

2 Likes

Hello, thank you for your response!
I think I could do exactly what you instructed about step 1 (please check below if it what you meant)
But about step 2, I couldn’t understand what you mean, how to check if the date exists? unlike step 1, there was no option to see whether if exists in database or not as far as I tried, and what do you mean by edit?
I know it takes time but it will be wonderful if you could explain it with some screenshots.

Thank you.


Of course,

Here’s how it works on my app; (Also there’s a few things I forgot to mention)

They enter their time code in and hit punch, and the first step is, we search for that employee’s time code and once we find it, we set them as the User for the time punch.
Now, what I did in my app was on the User data type, I added a field that was In/Out. (Default is out), so that way whenever we’re creating/editing a data entry, we know if they are in, it must be changed to out, or if they are out it must be changed to in.

So;

I Trigger ClockOut if their current status is In which does the following

So how I got to this point is, since I know it’s in, we Make a change to a Time Clock, Do a Search For Time Clock, Where Status is In, and we change the Last Item. My thought is, if they are in, than we just search for their last time clock and change that time clock. If they are out, we just create a new time clock entry.

And now that I’m looking at this, I realized I could just create a TimeClock entry in the User Data type, and any time they clock in, it sets that TimeClock in their User Data Type, so when they are clocking out, it doesn’t have to do any searches through a bunch of data, it can just change what’s already saved in their User. And of course, when they clock out, it can just clear it, so that way when they clock in again we know it’s an empty field, so we can just create a new data entry.

Hopefully this leads you in the right direction!

1 Like

@bcart0v Thank you for your response, even though I really appreciate your dedicated answer, I barely can figure out how it’s working since I’m newbie to bubble and not even engineer…, all I want is that User push the 4 diffrent buttons and record the time and administrator can check workers time on admin page. I will give up doing it myself, but thank you for your patience!

hi @nishizawa,

Benjamin’s solution is great! if you are still finding it difficult here is an alternative. See how simple it can be if you would change your data structure. It really is very simple, don’t give up just yet!

https://drive.google.com/file/d/1xuxsGYNA_5WHmzobnmhQQtMMRkLURJZx/view?usp=sharing

Good luck!

3 Likes

@hanan1
woooow! I made it! I was actually almost close, what I did was create a new thing when start work was clicked, and created all 4 inputs and when other buttons was clicked, I made change the value.
But it didn’t work since the changed value was not same cell’s one. But anyway thank you so much for you even taking video for me to show how it works and explain, also as a junior ux designer who seeking the path to able to design and also implement not so complex staff using bubble by myself, you are so inspiring because you are already doing what I want to do at very high level I assume. So please keep it up! I will follow and check your post on several medias sometimes!

1 Like

how kind of you @nishizawa! thanks for the nice word and will be glad to offer any help you need further on. I am happy it finally worked and I wish you the best of luck!

@hanan1
Hello hana! I would like to make the new field which shows the total work hours of each worker both for a day and month. I tried input finish work substract input start work but it’s not working.
Here is the editor, could you look at it pls?

hey @nishizawa!

sorry for the late reply. I am out of office. The editor link you shared is private, could you maybe change it so I can see what you are trying to do?

1 Like

hi @nishizawa!

no need to share your editor link. No worries, I added what you asked for to the demo I created for you earlier.

  1. Add a property to the time entry field to save the day total for each working day.

  2. Add a column to the table to show the new added property.

  3. Change the clockout workflow to calculate the day total when an employee clocks out

  4. Add a workflow that calculates the day total for all previously created entries in your system on page load (run it once, then delete this workflow).

  5. Now add a dat picker on the page to select the month to show all entries for and add a filter to show only entries for that month.

  6. Add a text that shows the month total for selected employee and month:

remember to run once then delete the flow on page load

Here is the editor link so you can play around with it.

1 Like

Hello @hanan1 Thank you for your dedicated answer! I tried exactly(I double checked so I believe it’s correct) what you instructed but seems like the day total number is incorrect, and I don’t know where this number coming from, and I checked your editor and same thing happened, could you help me to check what is going wrong??

My editor: https://bubble.io/page?type=page&name=home&id=pjt-dodrive-for-manager&tab=tabs-1
In case pass and id are required to see the preview
Pass/id: dreamly

hey @nishizawa,

I reactivated the action on page load. you can refresh to try it again.

1 Like

Hello @hanan1

I am sorry for late reply I was being so busy recently so couldn’t reply you, and thank you so much for you did it for me, but everytime I activate the workflow of page is loaded~, it works for only first time, but after that it doesn’t work. Do I have to do active and deactive everytime to make it work?? Or maybe I can schedule the workflow then?

hey @nishizawa!

I finally found out what was wrong and fixed it. We were editing the day total in the same step as the clock out so the operation was done on an empty field. Here is how we fix it:

  1. remove the workflow on pageload. delete it completely.
  2. on clockout, make the day total calculation after the clockout has been recorded:
    first step:

    second step:

no need to schedule anything.

1 Like

hello @hanan1
Thank you so much for you think the solution with me! and it worked! Now it can calculate the work hour every-time :smiley: One last thing I am trying to achieve is considering the total break time, why I call it “total” break time is because of the assumed user case is that they will have multiple break time in a day, and what I have tried so far to achieve it is the below.
But the number in total work hour become so big like last time, so I may operating the flow on an empty field. Could you check what is wrong with this workflow when you have time pls?

I have added the fields “break time” and “total break time” and I changed the field “start break” and “finish break” to list of numbers from number.



everytime when finish break is clicked, I made total break time