Grab Clappia’s 50% OFF Black Friday Deal before it’s gone! Ends 05 Dec 2025.
View offer →
#bf-banner-text { text-transform: none !important; }
Table of Contents
Still need help?
Request support
Request Support
Help
 / 
 / 
Technical FAQs
 / 

How to Add and Track Work Hours in a Job-Tracking Form?

"I’m creating a job-tracking app for freelance and field staff. Right now, I have fields for job name, client, and notes, but I also want users to log the exact number of hours they spent on each task. Ideally, they should be able to type or select the hours worked, and then I can calculate payment or productivity reports from that. What’s the simplest way to add and track work hours inside the form?"

Before you can track work hours, you need a Clappia app to track them in. A job-tracking app would typically have fields for employee details (name, ID, designation), the job or project, the client, and any notes about the task. If you haven't built the app yet, see How to Build an App in Clappia for setting up the app and adding these basic fields. This article focuses on the next part: adding work hours tracking to the form you've already built.

The simplest setup is to capture login and logout times using Clappia's Time Selector Block, then use a Formula Block to calculate the total hours worked. This avoids users having to type their own totals and gives you an accurate record for payment and productivity reports.

Features Used in This Setup

Two Clappia blocks do the work. The Time Selector Block captures the login and logout times, and the Formula Block calculates the difference between them. Users will also use the Submissions tab to return to their entry and add the logout time at the end of their work session.

Add Time Selector Blocks for Login and Logout

Add two Time Selector Blocks to your form, one for the start of a work session and one for the end. Name them "Login Time" and "Logout Time".

Each block in Clappia has a variable name, which is a short ID used to reference that block from other places in the app like formulas, workflows, and reports. When you add a block and save it, Clappia auto-generates a variable name from the label, but you can edit it in the block's right panel (the settings area that opens when you click a block). For this setup, set the variable names to something short and easy to read if you want to:

  • Login Time → variable name: login_time
  • Logout Time → variable name: logout_time

You will use these names in the formula in the next step. For more on variable names and the right panel, check this guide.

Also mark Login Time as Required in its right panel set up so no one can submit the form without it. Leave Logout Time optional, since it gets filled in later.

Add a Formula Block to Calculate Hours Worked

Add a Formula Block below your two time blocks. A Formula Block runs a calculation using values from other blocks in the same form, and the result updates automatically once those values are filled in.

To reference another block inside a formula, use the @ symbol followed by that block's name. So @logintime refers to the Login Time block, and @logouttime refers to the Logout Time block.

A simple formula to calculate total hours worked looks like this:

{logout_time} - {login_time}

This gives the time difference between the two values. Depending on how Clappia's Time Selector returns the difference, you may need a conversion (for example, dividing by 60 if the result is in minutes). The Formula Block help article covers time difference functions and unit conversion in full.

To calculate payment, multiply the total hours by the hourly rate. If you name your hours formula block as Total Hours and the hourly rate is 500:

{total_hours} * 500

You can keep this as a second Formula Block or combine both calculations into one, whichever is easier to read.

If you don't want users to see the calculation in the form, you can hide the Formula Block from the form view using the "Hide from form" option in its right panel under the Advanced tab.

How Users Log Their Hours

Here is how an end user uses the app once it's set up:

  1. At the start of work, the user opens the app, fills in Login Time, and submits. Logout Time stays empty for now.
  2. At the end of work, the user opens the Submissions tab (the list of entries they have already submitted), selects their earlier submission, fills in Logout Time, and saves.
  3. As soon as both times are filled, the Formula Block calculates the total hours automatically and the submission updates with the result.

For this flow to work, users need permission to edit their own submissions. This is set in the app's Distribute tab → User Access, which controls who can do what inside the app. See Permission-Based Access in Clappia for how to assign these permissions.

Use Cases

  • Freelancer invoicing. Capture the exact time spent on each task so invoices match real hours worked instead of estimates.
  • Field staff shift tracking. Login when arriving at a site, logout when leaving. The form becomes a digital timesheet you can audit later.
  • Project hour allocation. Track time across tasks within a project to see where hours are going and which projects are over budget.
  • Subcontractor billing. Each subcontractor logs their own hours; the calculated totals feed straight into a payment report without manual collation.

Troubleshooting

The Formula Block shows nothing or an error. Check that both Login Time and Logout Time are filled in. The formula only computes once both values exist. Also confirm the variable names in the formula match exactly what's set on the time blocks. A typo like @login_tim instead of @login_time will break the calculation.

The user can't see or edit their earlier submission. Open the app's Distribute tab and confirm the user has access to view and edit their own submissions. Without edit permission, they can't add the logout time to an existing submission.

Total hours look wrong. Confirm that the formula is computing the difference in the unit you expect (hours or minutes). The Formula Block help article covers time conversion in detail.

Tips

  • Use short, clear variable names like login_time and logout_time. Long or vague names make the formula harder to read and easier to mistype.
  • Test the full flow with one submission before rolling out to your team. Fill in Login Time, save, reopen the submission, fill in Logout Time, and confirm the Formula Block shows the right total.
  • If your team works overnight shifts (where logout falls on the next day), use a Date Time Selector block instead of a plain Time Selector, so the date is captured along with the time.

Related Help Articles

FAQs
Try our free plan
It will answer many more questions within just 15 minutes.