> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/opportunities/_getdt.md).

# \_getDT

Returns details of Opportunities based on search and a selected date period:

### Parameters

#### start

The number of Opportunities skipped before this function begins to return results.

#### length

The number of Opportunity results which will be returned

#### search\[value]

A string value which will filter out any Opportunities which do not include the string within.

#### order\[column]

The topic which will be used to order the given results.

#### order\[dir]

Displays the results in ascending or descending order, based on a topic chosen by the "column" parameter. ("asc" or "desc")

#### dateFrom

The earliest number of days before, which results will be returned from.\
(Relative to the day this function is used, e.g "-7" will return results as old as a week before the current date)

#### dateTo

The most recent day which results will be returned from.

#### draw

A value to determine the most recent execution of this function, increases by 1 every use, highest number being the most recent use of this function.

### Example

```
FM_api('Opportunities_getDT', [
    'draw' => '0',
    'order' => [
        [
            [
            'column' => '0',
            'dir' => 'asc'
            ]
        ]
    ],
    'start' => '0',
    'length' => '10',
    'search' => [
            'value' => ''
            ],
    'dateFrom' => '-30',
    'dateTo' => '0'
    ]
);
```

#### On Success

```
{"data":[["60007","1714921557","460775","92447","712758","3","",[null,null],"1","7",null,"",""],["60008","1714921504","490443","92447","712758","0","waldjkvns",[null,null],"1","7",null,"",""],["60009","1714921512","460775","92447","712758","0","wadgkvj",[null,null],"1","7",null,"",""]],"draw":1,"recordsTotal":9,"recordsFiltered":3}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/opportunities/_getdt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
