# \_getDT

Gathers details on a chosen number of Clockin entries, can be filtered by relation to flags or skipping an amount of entries beforehand.

### Parameters

#### draw

A number assigned to each use of this function, increases by 1 per use.\
Useful when identifying recent versions of the desired data

#### length

The number of Clockins which will be checked and filtered

#### start

The amount of Clockins which will be skipped before a number of later Clockins are checked, relative to the "length" parameter

#### flag

An integer which, depending on its value, will filter User Clockins based on whether they are flagged:\
-1 => All User Clockins, regardless whether they are flagged or not\
0 => Flagged Clockins are not included\
1 => Only Flagged Clockins are included

### Example

```
FM_api('UserClockins_getDT',[
  'draw'=>'0',
  'length'=>'2',
  'start'=>'0',
  'flag'=>'0'
  ]
);
```

### Results

#### On Success

In this example, there are two Clockin entries:\
One for the 31st of July 2023 with the ID "60001" and the note "Clockin Time Notes" within the Clockin time (06:30 to 16:30)\
One for the 7th of August 2023 with the ID "60002" and the note "Test Notes" for the whole Clockin entry (14:30 to 19:00)\
Neither are Flagged and all their times have 0 Lateness.

```
{
    "recordsTotal":"2",
    "recordsFiltered":"2",
    "draw":0,
    "data":[
        [
            "60002",
            "92447",
            "2023-08-07",[
                1691415000,
                1690710922,
                0,
                "[]"
            ],[
                1691431200,
                1690710922,
                0,
                "[]"
            ],
            "0",
            "[
                {
                 \"content\": \"Test Notes\",
                 \"createdby\": 92447, 
                 \"noteTime\": 1690712563853
                }
            ]",
            ""
        ],
        [
            "60001",
            "92447",
            "2023-07-31",[
                1690781400,
                1690710901,
                0,
                "[
                    {
                     \"content\":\"Clockin Time Notes\",
                     \"noteTime\":1690714089898,
                     \"createdby\":92447
                    }
                ]"
            ],[
                1690817400,
                1690710901,
                0,
                "[]"
            ],
            "0",
            "[]",
            ""
            ]
        ]
    }
```

#### On Failure

If the "draw" parameter is not set:

```
{"error":"missing or invalid parameter: draw"}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/userclockins/_getdt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
