---
title: "Timesheet Line Items tab"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/6359384117/Timesheet%20Line%20Items%20tab"
format: markdown
---
## Description

**Tab contains component **`FTimeSheetDayToolbar` that allows to show list of Timesheet line items related to Work Order. This is how it looks in FieldBuddy Swift.  


It also shows totals of the time registrations.

It is possible to configure the content of the layout of each timesheet line item entry.

## Sample Structure

Configuration of tab consist out of few properties:  


```
{
    "body": {
        "config": {
            "groupBy": {
                "field": "FIELDBUDDY__Start_Time__c",
                "table": "FIELDBUDDY__Timesheet_Lineitem__c"
            },
            "statsBar": {
                "config": {
                   ///
                },
                "type": "FTimeSheetStatsMenu"
            },
            "item": {
                "config": {
                  ///
                },
                "type": "FTimeSheetListItem"
            },
            "empty": {
                "line1": "${Label.NoTimeSheetsLine1}",
                "line2": "${Label.NoWorkOrdersLine2}"
            }
        },
        "type": "FTimeSheetDayToolbar"
    },
    "actions": "${AddTimeSheetPlugin}",
    "header": {
        "title": "${Label.TimeRegistration}"
    }
},
```

Actions property allows you to modify what kind of action will be available in this tab. Omitting it removes the floating action button that allows user to create time sheet line items.

It is possible to modify dataText inside `FTimeSheetListItem` component to add/remove some of the fields

```
  "dataText": {
      "Body": "COMMENTS",
      "BodyExt": [
      ],
      "Footer": "${TYPE}",
      "Id": "ID",
      "Title": "START_TIME - END_TIME",
      "Reference": "${WO}",
      "Avatar": "${TYPE2}"
  },
```

- `dataText` contains the properties that define what is displayed.
- **Important:**
  - `Id` and `Avatar` must not be changed!
  - Every field referenced in `dataText` must also be defined in the `dataBinding` section.
  - It is possible to change values of the fields inside  `Footer`, `Body`, `BodyExt` or `Title` are visual elements and can be used to display static text or variables mentioned in `dataBinding`.

> ⚠️ There is a known issue that in case if Location/Account fields are specified in BodyExt in configuration - wrong address is shown. It is on our roadmap to fix it but at the moment advice is to keep it empty in configuration, so use
> ⚠️ 
> ⚠️ ```
> ⚠️ "BodyExt": [],
> ⚠️ ```
> ⚠️ 
> ⚠️ instead of
> ⚠️ 
> ⚠️ ```
> ⚠️ "BodyExt": [
> ⚠️         "${CUSTOMER}",
> ⚠️         "${STREET} ${HOUSE} ${SUFFIX}",
> ⚠️         "${ZIP} ${CITY}"
> ⚠️ ],
> ⚠️ ```

# Reference configuration

<details>
<summary>Config structure</summary>

```
{
    "body": {
        "config": {
            "groupBy": {
                "field": "FIELDBUDDY__Start_Time__c",
                "table": "FIELDBUDDY__Timesheet_Lineitem__c"
            },
            "statsBar": {
                "config": {
                    "limitToSelectedDay": false,
                    "groupBy": {
                        "field": "FIELDBUDDY__Type__c",
                        "table": "FIELDBUDDY__Timesheet_Lineitem__c"
                    },
                    "params": {
                        "parentTableName": "FIELDBUDDY__Timesheet_Lineitem__c",
                        "title": "${FIELDBUDDY__Timesheet_Lineitem__c.label}"
                    }
                },
                "type": "FTimeSheetStatsMenu"
            },
            "item": {
                "config": {
                    "dataBinding": [
                        {
                            "field": "Id",
                            "table": "FIELDBUDDY__Timesheet_Lineitem__c",
                            "var": "ID"
                        },
                        {
                            "field": "Name",
                            "table": "FIELDBUDDY__Timesheet_Lineitem__c",
                            "var": "NAME"
                        },
                        {
                            "field": "Name",
                            "table": "FIELDBUDDY__Work_Order__c",
                            "var": "${WO}"
                        },
                        {
                            "field": "FIELDBUDDY__Comments__c",
                            "table": "FIELDBUDDY__Timesheet_Lineitem__c",
                            "var": "COMMENTS"
                        },
                        {
                            "field": "FIELDBUDDY__Type__c",
                            "table": "FIELDBUDDY__Timesheet_Lineitem__c",
                            "var": "${TYPE}"
                        },
                        {
                            "field": "FIELDBUDDY__Type__c",
                            "table": "FIELDBUDDY__Timesheet_Lineitem__c",
                            "var": "${TYPE2}"
                        },
                        {
                            "field": "FIELDBUDDY__Start_Time__c",
                            "format": "HH:mm",
                            "table": "FIELDBUDDY__Timesheet_Lineitem__c",
                            "var": "START_TIME"
                        },
                        {
                            "field": "FIELDBUDDY__End_Time__c",
                            "format": "HH:mm",
                            "table": "FIELDBUDDY__Timesheet_Lineitem__c",
                            "var": "END_TIME"
                        },
                        {
                            "field": "localId",
                            "table": "FIELDBUDDY__Timesheet_Lineitem__c",
                            "var": "LOCAL_ID"
                        }
                    ],
                    "dataText": {
                        "Body": "COMMENTS",
                        "BodyExt": [
                        ],
                        "Footer": "${TYPE}",
                        "Id": "ID",
                        "Title": "START_TIME - END_TIME",
                        "Reference": "${WO}",
                        "Avatar": "${TYPE2}"
                    },
                    "events": [
                        {
                            "dataBinding": [
                                {
                                    "alias_field": "Id",
                                    "alias_table": "FIELDBUDDY__Work_Order__c",
                                    "field": "FIELDBUDDY__Work_Order__c",
                                    "table": "FIELDBUDDY__Timesheet_Lineitem__c"
                                },
                                {
                                    "alias_field": "Id",
                                    "alias_table": "FIELDBUDDY__Timesheet_Lineitem__c",
                                    "field": "Id",
                                    "nested": true,
                                    "table": "FIELDBUDDY__Timesheet_Lineitem__c"
                                }
                            ],
                            "eventName": "onGoDetails",
                            "target": "LineItemUpsert",
                            "triggeredEvent": "navigate"
                        }
                    ]
                },
                "type": "FTimeSheetListItem"
            },
            "empty": {
                "line1": "${Label.NoTimeSheetsLine1}",
                "line2": "${Label.NoWorkOrdersLine2}"
            }
        },
        "type": "FTimeSheetDayToolbar"
    },
    "actions": "${AddTimeSheetPlugin}",
    "header": {
        "title": "${Label.TimeRegistration}"
    }
},
```
</details>