Skip to content

timeTracker

The time tracker feature consists of 2 separate menus: timeTrackStart and timeTrackStop. Below is information for each menu.

Warning

A time tracker can't have a create action in the then part of the timeTrackStop. If any timeTrackStart has a create action in the then part, it is not possible to have a create action in the timeTrackStop menu chain. In these cases, the timeTrackStop must use a createForm and form with "mode" = "save" in the then actions.

Tip

If you plan on using the TimeTracker on mobile, please make sure that the use case you include it in supports offline. Several features here do not work fully if switching between online and offline, and the use case is not downloaded locally on each client.

timeTrackStart

actionValues Description
maxTrackTime Set the resulting duration object to the configured maxTrackTime, if the tracked time would exceed the configured time
ignoreRunning To ensure that the menu is always displayed, this setting can be made

timeTrackStart starts a time tracker for the current object. The time tracker continues to run even if you open other objects or trees in Insight. A running time tracker is displayed in the upper right corner with the elapsed time. Clicking on the time automatically returns the user to the object for which the time tracker was started.

If the timeTrackStart menu is clicked a second time on an object other than the one on which the time tracker is running, the running time tracker is stopped and a new one is started for the current object.

If timeTrackStart contains a then action for create, the time tracker will be applied to the newly created object after creation. The time tracker will start when the creation page loads and will already be running when the user fills out the object. Canceling the creation will also stop the time tracker.

{
    "label": "Time",
    "icon": "icon-play",
    "action": "timeTrackStart",
    "actionValues": [
        {
            "maxTrackTime": 3600000,
            "ignoreRunning": true
        }
    ]
}

timeTrackStop

actionValues Description
ignoreRunning To ensure that the menu is always displayed, this setting can be made

The timeTrackStop action stops a running time tracker. It is not necessary to consider the visibility of the menu, as it is only displayed when a time tracker is started. If you want the menu to always be displayed, you can set ignoreRunning in the actionValues.

Important: Handle the timeTracker result

It is necessary to handle the timeTracker result yourself. Once the menu chain of timeTrackStop is completed, the timeTracker result will be permanently removed. Make sure to save or process the data within the then action chain.

{
    "label": "Time",
    "icon": "icon-stop-circle",
    "action": "timeTrackStop",
    "actionValues": [
        {
            "ignoreRunning": true
        }
    ],
    "then": {
        "label": "Zeitrückmeldung",
        "action": "create",
        "icon": "icon-clock"
    }
}

Handle the timeTracker result

When a time tracker is stopped, the result is automatically passed to the following then actions as $payload. The payload contains comprehensive information about the tracked time session, including the calculated durations in multiple time units for flexible use in your configuration.

The $payload object contains the following properties:

Property Type Description
isRunning boolean Indicates whether the time tracker is currently running
startedAt number Start timestamp in milliseconds
startedAtDate string Start date and time in ISO format
duration object Object containing the calculated durations in multiple time units
duration.milliSeconds number Total duration in milliseconds
duration.seconds string Total duration in seconds (formatted as decimal string)
duration.minutes string Total duration in minutes (formatted as decimal string)
duration.hours string Total duration in hours (formatted as decimal string)
duration.days string Total duration in days (formatted as decimal string)
endedAtDate string End date and time in ISO format
url string URL of the object where the time tracker was started
isCreate boolean Indicates whether the time tracker was started during object creation

In this example, the tracked time is automatically transferred to a newly created object. The hours are stored in a field called duration, and the start date is stored in a field called startDate:

{
    "label": "Stop Time",
    "icon": "icon-stop-circle",
    "action": "timeTrackStop",
    "then": {
        "label": "Create Time Entry",
        "action": "createForm",
        "icon": "icon-clock",
        "actionValues": [
            {
                "_node": "TIMEENTRY",
                "duration": "${$payload.duration.hours}",
                "startDate": "${$payload.startedAtDate}",
                "endDate": "${$payload.endedAtDate}"
            }
        ],
        "then": {
            "action": "form",
            "actionValues": [
                {
                    "mode": "save",
                    "attributes": [
                        {
                            "name": "duration"
                        },
                        {
                            "name": "startDate"
                        },
                        {
                            "name": "endDate"
                        }
                    ],
                    "confirmLeave": true,
                    "dirtyCheck": true
                }
            ]
        }
    }
}