The Clock app is the companion app for the people who actually work the shifts: candidates, temps, contractors and permanent staff. It is a portable web app that installs to a phone home screen and receives push notifications. Workers use it to see and confirm their upcoming shifts, clock in and out with a GPS location stamp, record breaks and expenses, tell you when they are available or unavailable, and browse and claim open shifts from a self-service marketplace.
The Clock app closes the loop between the office and the field:
Everything on those screens is driven by an app definition, so an admin decides which tabs appear, which fields are on each form, and how records are scoped to the signed in worker. There is no per tenant code.
The Clock app runs in two hosting contexts.
| Host | Who the user is | How access is granted |
|---|---|---|
| Community / Digital Experience page | Authenticated community user resolved via their Contact | Standard object, field and sharing permissions apply, including on save. |
| 3B Portals guest page | Site Guest User with a session key | The session key identifies one Contact and expires. The app acts only for that Contact. |
The app type is Clock In / Out Component, which is one of the session key protected apps. On a portal page a guest needs a valid session key. The session key identifies one Contact and expires, and the merge tags below always resolve to that Contact.
The Clock app can also be embedded inside the Terminal app as a kiosk. In that case the Terminal passes the identified worker and the site location to the embedded Clock, which uses the Terminal's kiosk access model.
The whole app is configured by a single Custom Metadata record of type b3s__Component_Configuration__mdt whose b3s__Type__c is Clock In / Out Component. Its b3s__JSON__c field holds the entire app definition as one JSON document. A worked example ships as one of the Custom Metadata records included as sample configuration with the package, named Clock In/Out Config, and the rest of this article walks through it.
The definition has two parts: a set of top level options that switch whole features on and off, and a schedulables object that describes each type of record the app reads and writes. The JSON grammar shared by every WFM app, the selector and condition syntax, the decoration and title formats, is documented once in the App definition JSON reference; this article covers only what is specific to Clock.
{
"timezonePreference": "client",
"defaultLanguage": "en-GB",
"availableLanguages": ["en-GB", "es-ES"],
"currentShiftSearchRange": 120,
"firstDay": 0,
"is24Hour": true,
"canAddBreaks": true,
"canAddExpenses": true,
"canSeeExpenses": true,
"canSearchShifts": true,
"canAddShifts": true,
"canAddAvailability": true,
"isGPSRequired": true,
"canClockInOut": true,
"canStartAdhocShifts": true,
"syncTimeout": 10000,
"navMenuItems": [ ... ],
"schedulables": { ... }
}
| Key | Type | Controls |
|---|---|---|
timezonePreference |
string | client uses the worker's device timezone for display. The alternative resolves times against the site timezone. Wire values to and from the server are always UTC. |
defaultLanguage |
string | The starting locale. |
availableLanguages |
string[] | The languages offered in the switcher. |
currentShiftSearchRange |
number | Minutes on either side of now used to pick the "current" shift for the clock screen. Mirrored on the shift schedulable so the clock screen and the shift list agree. |
firstDay |
number | First day of the week in date pickers. 0 is Sunday. |
is24Hour |
boolean | 24 hour versus 12 hour time display. |
canAddBreaks |
boolean | Shows the Add Break action. Also gated on the shift being in progress. |
canRecordBreaks |
boolean | Lets workers start and end a break from the clock button. Off unless set to true. See Clock breaks. |
canAddExpenses |
boolean | Allows creating expense records. |
canSeeExpenses |
boolean | Whether the Expenses tab appears at all. Set this false and expenses are hidden even if canAddExpenses is true. |
canSearchShifts |
boolean | Whether the open shift marketplace tab appears. |
canAddShifts |
boolean | Allows creating a shift by hand from the app. |
canAddAvailability |
boolean | Allows creating availability requests. |
disableLocation |
boolean | Set to true to disable location requests and coordinate storage throughout the Clock app. Defaults to false. Overrides isGPSRequired and check-in collectLocation. |
isGPSRequired |
boolean | Requires a GPS lock before clock in or out is permitted, unless disableLocation is true. When true and the device denies location, the clock button stays disabled. Setting this to false alone does not stop location requests. |
canClockInOut |
boolean | Master switch for the clock in and out button. |
canStartAdhocShifts |
boolean | Allows starting a shift with no scheduled record behind it, for unplanned work. |
syncTimeout |
number | Milliseconds between background re sync cycles that pull in changes made elsewhere. |
navMenuItems |
object[] | Extra links in the nav menu (see below). |
schedulables |
object | The per object definitions, keyed by role: shift, invitation, request, expense, break, task, geoTag. |
In the Component Configuration custom metadata record for Clock In / Out Component, add this root property to the existing JSON (b3s__JSON__c) configuration:
{
"disableLocation": true
}
Use this for deployments that must not collect worker GPS coordinates, or deployments using only availability, shift search or invitations through targetView. The setting applies to every Clock app view, including when the worker later navigates to the clock screen. Target views are selected before rendering, so opening targetView=requests, targetView=searchShifts or targetView=currentInvites does not briefly load the clock map.
When enabled, the Clock app does not request browser location, poll for location, or offer location refresh or Add Geo Point. Clock in/out, breaks and check-in continue to record timestamps with empty coordinate and location-error fields. This also discards coordinates supplied by an embedding terminal. The map can still display the configured work site; it does not display the worker's position. Other Terminal app location settings are independent.
disableLocation takes precedence over isGPSRequired: true and schedulables.shift.checkIn.collectLocation: true, so attendance actions do not wait for a GPS fix. Exception forms receive $clock.locationUnavailable: true and no distance or accuracy; review any mandatory exception rules that depend on these values. Existing stored coordinates are not deleted. Omitting the setting or setting it to false preserves location collection. Configuration is cached at startup for up to 120 minutes, so allow the cache to expire before verifying a changed configuration in an existing session.
navMenuItems adds links to the menu, typically to hop to a sibling portal app. Each entry is { label, translationKey?, href }. The href supports portal deep links and can carry the same merge tags used elsewhere, so a link can pass the signed in worker's id straight through:
"navMenuItems": [
{ "label": "Timesheets", "translationKey": "menuTimesheets", "href": "#Timesheet_Submission?contactId=:userId" },
{ "label": "Documents", "href": "#Compliance" }
]
The first link opens Timesheet submission scoped to the current worker. translationKey lets the label be localised.
Every schedulable that a worker should only see their own rows of carries a selectionClause, a SOQL fragment that is merged and executed on the server. The merge tags resolve on the server to the signed in worker. The two tags that matter most for Clock are:
| Tag | Resolves to | Typical use |
|---|---|---|
:contactUserId |
The Id of the signed in worker's Contact | Scope records whose owner field is a Contact lookup, for example b3s__Contact__c = :contactUserId. |
:userId |
The signed in user identity as used by the app | Default values on forms and deep link parameters, for example a default of :userId on a Contact field. |
Context tags such as :contextId, :contextStart, :contextEnd and :contextDate are also available for defaults and clauses; they resolve to the record and date window the screen is currently working with. The full tag list is in the App definition JSON reference. All tags are resolved on the server.
Set "canCheckIn": true to let workers confirm attendance ahead of upcoming shifts. It is off by default and tuned by shift.checkIn. See Shift check-in.
The shift schedulable is the centre of the app. It binds b3s__Shift__c and drives three things at once: the worker's own shift list, the clock in and out screen, and the open shift marketplace.
Core field paths:
"shift": {
"objectType": "b3s__Shift__c",
"startFieldPath": "b3s__Scheduled_Start_Time__c",
"endFieldPath": "b3s__Scheduled_End_Time__c",
"scheduledStartFieldPath": "b3s__Scheduled_Start_Time__c",
"scheduledEndFieldPath": "b3s__Scheduled_End_Time__c",
"actualStartFieldPath": "b3s__Actual_Start_Time__c",
"actualEndFieldPath": "b3s__Actual_End_Time__c",
"absoluteStartFieldPath": "b3s__Absolute_Start_Time__c",
"absoluteEndFieldPath": "b3s__Absolute_End_Time__c",
"siteTimezoneFieldPath": "b3s__Work_Site__r.b3s__Timezone__c",
"contactFieldPath": "b3s__Contact__c",
"selectionClause": ["b3s__Contact__c = :contactUserId"],
"currentShiftSearchRange": 120,
"lookBackLimitDays": 14,
"lookForwardLimitDays": 14,
"allowAdhocShifts": true
}
| Key | Purpose |
|---|---|
startFieldPath / endFieldPath |
The scheduled window used to place a shift on the timeline. |
actualStartFieldPath / actualEndFieldPath |
Written by clock in and clock out, the verified worked times. |
absoluteStartFieldPath / absoluteEndFieldPath |
The outer bounds used for overlap and look back and forward windows. |
siteTimezoneFieldPath |
The timezone the shift's times are shown in when timezonePreference uses the site. |
contactFieldPath |
The Contact lookup that ties a shift to a worker. |
selectionClause |
Scopes the list to the signed in worker. |
currentShiftSearchRange |
Minutes around now used to pick the shift the clock screen defaults to. |
lookBackLimitDays / lookForwardLimitDays |
How far back and forward the shift list loads. |
allowAdhocShifts |
Permits creating an unplanned shift, paired with the top level canStartAdhocShifts. |
Clock and geo behaviour. The clock screen shows a small map, and these paths feed it:
"shiftSiteFieldPath": "b3s__Work_Site__c",
"shiftLatFieldPath": "b3s__Work_Site__r.b3s__Location__Latitude__s",
"shiftLonFieldPath": "b3s__Work_Site__r.b3s__Location__Longitude__s",
"defaultUserLat": "51.509865",
"defaultUserLon": "-0.118092",
"defaultZoom": 14,
"canStartShift": true,
"canFinishShift": { "condition": { "allOrSome": "all", "selectors": [
{ "field": "Id", "operator": "isnull", "value": false } ] } }
The map renders a minimal light basemap from a hosted tile service; no map API key or org configuration is required. The site lat and lon position the shift on the map; defaultUserLat / defaultUserLon are the fallback centre when the device has not yet returned a fix. canStartShift and canFinishShift gate the clock buttons, the latter shown here requiring the shift to already exist. When isGPSRequired is true the actual coordinate at clock time is captured and written as a geo tag (see the geoTag schedulable).
Quick actions. The shift list exposes one tap actions. Each has a label, an icon, success and error messages, an optional confirmation prompt, a visibleIf condition, and the updateFields it applies:
"quickActions": [
{
"label": "Confirm",
"successMessage": "Shift confirmed",
"errorMessage": "Failed to confirm shift. Error: {0}",
"confirmationMessage": "Are you sure?",
"visibleIf": { "condition": { "allOrSome": "all", "selectors": [
{ "field": "b3s__Status__c", "operator": "notequals", "value": "Confirmed" } ] } },
"updateFields": [ { "field": "b3s__Status__c", "value": "Confirmed" } ]
},
{ "label": "Cancel", "updateFields": [ { "field": "b3s__Status__c", "value": "Cancelled" } ], "...": "..." },
{ "label": "Request shift swap", "updateFields": [ { "field": "b3s__Status__c", "value": "Requested Swap" } ], "...": "..." }
]
The {0} in an error message is filled with the server error. visibleIf hides an action once it would be a no op, so Confirm disappears on an already confirmed shift.
Decorations and top border. decorations add status badges. The sample flags a started shift (actual start not null) and an ended shift (actual end not null). topBorder colours the card edge by status:
"topBorder": { "match": { "field": "b3s__Status__c", "equals": {
"New": { "literal": "border-t-amber-600 border-t-4 border-t-solid" },
"Cancelled": { "literal": "border-t-red-500 border-t-4 border-t-solid" },
"Confirmed": { "literal": "border-t-green-500 border-t-4 border-t-solid" }
}, "otherwise": { "literal": "" } } }
Titles. title is the summary shown on each shift card, an array of labelled field paths with formatters (startEnd, dateTime, string) and hideIfNull. Composite time paths use a colon, for example b3s__Scheduled_Start_Time__c:b3s__Scheduled_End_Time__c with the startEnd formatter. title entries can also nest child collections such as breaks and tasks so they appear inline on the card. openShiftTitle is the equivalent summary shown on a marketplace card, and homePageEditShiftFields is the form used to edit the current shift from the clock home screen.
Edit and delete gates, edit forms. canEdit and canDelete are conditions evaluated per record, for example allowing edit only while the shift's approval status is null or Rejected. recordFormFields is the full edit form, and actionForms.startShift / actionForms.endShift are the small forms shown straight after clocking in or out. Their isVisble, mandatory and per-field showIf / required conditions can test $clock.* facts about the tap, such as distance from the site, minutes early or late, and whether the shift is ad-hoc. Use them to collect a reason and authorisation for exceptions (see Clock in and out exception forms).
Auto-submit on clock out. clockOutFieldsSet on the shift schedulable lists field values written in the same save as the clock out time. Use it to send the shift straight for approval, so the worker does not have to submit it from Timesheet Submission:
"clockOutFieldsSet": [
{ "field": "b3s__Approval_Status__c", "value": "Submitted" }
]
Each entry is a field API name and the value to set (blank clears it). Values are saved as the worker, so the usual server checks apply: for Approval Status the Clock app may only write Submitted or clear it, so the worker can never approve their own shift. Leave the key out to keep clock out as before. Every form field follows the shared field contract documented in the RecordForm field reference, including nested type: "task", type: "break" and type: "record-files-manager" sections that manage child records inline.
Open shift marketplace. When canSearchShifts is on, the marketplace runs a separate query defined by matchSelectionClause, which finds confirmed shifts with no worker that the signed in worker has not already been invited to:
"matchSelectionClause": [
"Id NOT IN (SELECT b3s__Shift__c FROM b3s__Invitation__c WHERE b3s__Contact__c = :contactUserId) AND b3s__Contact__c = null AND b3s__Status__c = 'Confirmed'"
],
"matchingLoaders": ["contacts", "suitability", "certificates", "certRequirements", "candidateShifts"],
"contactsLoader": "contacts",
"claimOpenShiftLabel": "Claim Shift",
"rejectOpenShiftLabel": "Not Interested"
matchingLoaders names the supporting data sets pulled so the eligibility and compliance engine can score each open shift for this worker; contactsLoader names the loader that resolves the worker's own Contact context. claimOpenShiftLabel and rejectOpenShiftLabel label the two marketplace buttons. Claiming a shift creates an invitation at the accepted status (see the invitation schedulable). The loaders themselves are separate Custom Metadata records; see Data loaders.
The invitation schedulable binds b3s__Invitation__c and powers both the invites inbox and the accept side of claiming an open shift.
"invitation": {
"objectType": "b3s__Invitation__c",
"startFieldPath": "b3s__Shift__r.b3s__Absolute_Start_Time__c",
"endFieldPath": "b3s__Shift__r.b3s__Scheduled_Start_Time__c",
"statusFieldPath": "b3s__Status__c",
"contactFieldPath": "b3s__Contact__c",
"shiftFieldPath": "b3s__Shift__c",
"siteTimezoneFieldPath": "b3s__Shift__r.b3s__Work_Site__r.b3s__Timezone__c",
"seenTimestampFieldPath": "b3s__Seen_Timestamp__c",
"claimOpenShiftDefaultStatus": "Accepted",
"selectionClause": ["b3s__Contact__c = :contactUserId"],
"acceptButtonLabel": "👍 Accept",
"rejectButtonLabel": "👎 Reject",
"lookBackLimitDays": 14,
"lookForwardLimitDays": 14
}
Notable keys:
| Key | Purpose |
|---|---|
statusFieldPath |
The field driven by accept and reject. |
seenTimestampFieldPath |
Stamped when the worker opens the invite, so "new" badges clear. |
claimOpenShiftDefaultStatus |
The status an invitation is created with when a worker claims an open shift, Accepted here. |
acceptButtonLabel / rejectButtonLabel |
The two response buttons. |
Invitations carry their own quickActions (Accept, Reject) with visibleIf conditions, plus canAccept and canReject conditions that block a response once the invite is Booked or Revoked. Two dedicated forms, recordFormFieldsAcceptance and recordFormFieldsRejection, define what is written on each response. Because invitations summarise fields from the parent shift, additionalFields pulls extra related fields (job, site, account, group) into the query so title, filters and decorations can reference them, for example the "Shift New" and "Shift Confirmed" status badges.
The request schedulable binds b3s__Employee_Request__c and is the availability feature, gated by canAddAvailability.
"request": {
"objectType": "b3s__Employee_Request__c",
"startFieldPath": "b3s__Start__c",
"endFieldPath": "b3s__End__c",
"typeFieldPath": "b3s__Type__c",
"contactFieldPath": "b3s__Contact__c",
"siteTimezoneFieldPath": "b3s__Contact__r.b3s__Timezone__c",
"selectionClause": ["b3s__Contact__c = :contactUserId"],
"canEdit": null,
"canDelete": false
}
The record type field distinguishes the three states a worker declares, Available, Unavailable and Flexible Schedule, and background colours each card accordingly. Its recordFormFields include a field-time-range-selector with enableRepeatPattern: true, which lets a worker set a recurring availability pattern across weekdays in one save (the repeat expansion is DST safe). The Contact field defaults to :contactUserId and is disabled, so a worker can only ever create availability for themselves.
The expense schedulable binds b3s__Expense__c, gated by canAddExpenses for creation and canSeeExpenses for the tab's visibility.
"expense": {
"objectType": "b3s__Expense__c",
"startFieldPath": "b3s__Date_of_Expense__c",
"endFieldPath": "b3s__Date_of_Expense__c",
"isFieldPathDateType": true,
"contactFieldPath": "b3s__Contact__c",
"selectionClause": ["b3s__Contact__c = :contactUserId AND b3s__Contact__c != null"]
}
isFieldPathDateType tells the loader the date field is a Date, not a Datetime. canEdit and canDelete are conditions on approval status, edit allowed while the expense is unsubmitted, Rejected or Queried, delete only while it is unsubmitted, so a worker cannot alter an approved claim. The form captures date, category, currency, value, comments and a receipt file (field-file-upload with a maxFileSize), and filters and title drive the list. The Contact field defaults to :userId and is disabled.
The sample form also carries a hidden Treatment field so the admin, not the worker, decides how the claim is paid and billed:
{
"field": "b3s__Treatment__c",
"type": "field-select",
"hidden": true,
"required": false,
"disabled": true,
"default": "Payable and Billable"
}
Change the default to Payable (reimburse only) or Billable (recharge only) per app. The expense's client account and bill amount are stamped on save (see Pay and bill engine, Expenses).
break binds b3s__Break__c and task binds b3s__Shift_Task__c. Both are mostly managed as inline child collections from within the shift form (the type: "break" and type: "task" sections in recordFormFields), which is why the top level break schedulable only needs its object type and a small form, and task needs only its object type. The Add Break action on the clock screen is gated by the top level canAddBreaks and by the shift being in progress. Break form fields default the parent shift from :contextId.
With the top level canRecordBreaks: true, breaks are recorded live from the clock button instead of typed in after the fact. This stops workers clocking out of the shift when they only meant to go on break.
b3s__Break__c on the current shift with Start set to now and End blank, plus a Break Start geo tag. The button turns into End break with a break timer, and the status pill reads "On break since".Break End geo tag.The open break is found by running the break schedulable's selectionClause server side, so the state survives an app reload or a switch of device. Breaks recorded this way are manual breaks for the Break Engine: they are never regenerated, and a typed manual break suppresses the auto rule of the same type.
"break": {
"objectType": "b3s__Break__c",
"shiftFieldPath": "b3s__Shift__c",
"breakStartFieldPath": "b3s__Start__c",
"breakEndFieldPath": "b3s__End__c",
"typeFieldPath": "b3s__Type__c",
"clockBreakTypes": ["Meal", "Rest"],
"selectionClause": "b3s__Shift__r.b3s__Contact__c = :contactUserId AND b3s__Start__c != null AND b3s__End__c = null AND b3s__Shift__r.b3s__Actual_End_Time__c = null",
"recordFormFields": []
}
| Key | Purpose |
|---|---|
shiftFieldPath |
Lookup from the break to its shift. Default b3s__Shift__c. |
breakStartFieldPath / breakEndFieldPath |
Start and end date times of the break. Defaults b3s__Start__c / b3s__End__c. |
typeFieldPath |
Break type picklist. Default b3s__Type__c. |
clockBreakTypes |
Which Type picklist values to offer as break buttons. Omit to offer every active value; when the picklist has no values a single untyped Start break button is shown. Prefer typed breaks so the Break Engine does not also generate an auto break of the same type. |
selectionClause |
Required when canRecordBreaks is on. Must return the signed in worker's open breaks. Do not use startFieldPath here, it would add a date window and miss long breaks. |
Breaks and geo tags are saved with the same access as clock in and out.
The geoTag schedulable binds b3s__Geo_Tag__c and is written automatically at clock in and clock out; it has no user facing form.
"geoTag": {
"objectType": "b3s__Geo_Tag__c",
"shiftFieldPath": "b3s__Shift__c",
"latitudeFieldPath": "b3s__Location__Latitude__s",
"longitudeFieldPath": "b3s__Location__Longitude__s",
"timeFieldPath": "b3s__Tag_Time__c",
"typeFieldPath": "b3s__Type__c",
"locationErrorPath": "b3s__Location_Error__c"
}
| Key | Purpose |
|---|---|
shiftFieldPath |
Links the tag to the shift being clocked. |
latitudeFieldPath / longitudeFieldPath |
The device coordinate captured at the moment of the tag. |
timeFieldPath |
When the tag was taken. |
typeFieldPath |
The tag type: Clock In, Clock Out, Check In, Break Start or Break End. |
locationErrorPath |
The reported accuracy or error radius of the fix, useful for auditing whether a worker was genuinely on site. |
When isGPSRequired is true, a shift cannot be clocked without a fix, and the resulting geo tag is the on site evidence tied to the actual times on the shift.
Supporting reference data, contacts, jobs, placements, sites, locations, certificates, certificate requirements and existing candidate shifts, is fetched through loader records linked to this configuration. Forms reference a loader by name in a field's loader property (for example the Job field's "loader": "jobs"), and the marketplace names its loaders in matchingLoaders. Loaders never expose their query to the browser; they are executed on the server. See Data loaders for the loader contract and how to add one.
availableLanguages and defaultLanguage. Any label, filter or section in the definition can carry a translationKey so it participates in translation rather than showing a hard coded string.The Clock app is a push recipient. Once a worker has installed the app to their home screen and accepted notifications, they can receive alerts, for example new open shifts or shift changes, driven from the scheduler's bulk notification engine. Push delivery infrastructure is provided by the co installed 3B Portals package and requires its push credentials to be configured. See Scheduling notifications for how sends are triggered and logged.
canShowIdBadge, canScanTerminalQr, canEnrollBiometrics and the badge schedulable).request schedulable.