# getTask

An asynchronous method. Check the argument and return types below.

Canonical: https://chart.syidax.com/docs/methods/getTask/

<a id="definition"></a>

## Definition

```typescript
getTask(index: number): Promise<GanttTask | null>
```

| Arguments | Type | Required |
| --- | --- | --- |
| `index` | `number` | Required |

Return type: `Promise<GanttTask | null>`. Call the method after element registration and await its Promise result.

- [GanttTask](https://chart.syidax.com/docs/types/GanttTask.md) — Type definition

<a id="related"></a>

## Related charts

- [sy-gantt-chart](https://chart.syidax.com/docs/components/gantt.md#method-getTask)
