> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/display-tasks.md). Agents can also search and read this documentation through its [MCP server](https://docs.avonnicomponents.com/~gitbook/mcp).

# Display Tasks

Show an account's Tasks on an Avonni Timeline in a screen flow, grouped by month, so a service manager sees every call and follow-up before a meeting.

A service manager is about to call Harbor Point Logistics and wants to see every call, email and follow-up logged on the account, newest first. Here you load the account's Tasks with a **Get Records**, hand them to the **Avonni Timeline**, and group them by month.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FjINGIlOymPKkjlZh0IL0%2Ftimeline-display-tasks-result.png?alt=media" alt="Avonni Timeline in a screen flow listing the account&#x27;s Tasks grouped by month, the first one opened on its Status and Priority"><figcaption><p>The account's Tasks, grouped by month, newest first.</p></figcaption></figure>

## Before you start

* A screen flow with a text input variable `recordId`, launched from the Account record page with the record ID passed in. [How to pass your current RecordID in your screen flow](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/how-to-pass-your-current-recordid-in-your-screen-flow.md) shows how.
* A few Tasks related to the account (the **Related To** field set to the account).

## Steps

{% stepper %}
{% step %}

### Get the account's Tasks

1. In Flow Builder, add a **Get Records** element before the screen, for example `Get_Tasks`.
2. Set **Object** to **Task**.
3. Add the condition **Related To ID** (`WhatId`) **Equals** `{!recordId}`.
4. Under **How Many Records to Store**, choose **All records**.

The Timeline sorts the items by date itself, so no sort is needed here.
{% endstep %}

{% step %}

### Add the Avonni Timeline to a screen

1. Add a **Screen** element after the Get Records.
2. In the screen components panel, search for **Avonni Timeline** and drag it onto the screen.
3. Give it an **API Name**, for example `Account_Timeline`.
4. Click **Open Component Builder**.
   {% endstep %}

{% step %}

### Point the Timeline at the collection

1. In the **Properties** tab, open the **Data Source** section and click **Variable**.
2. In **Items Collection**, pick `Get_Tasks`.

The **Data Mappings** section appears. For a Task collection, **Title** is already filled with the Subject, **Description** with the Description and **Start Date** with the Due Date (`ActivityDate`).

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FaMFem1RUeLtpOMQdeOag%2Ftimeline-display-tasks-data-source.png?alt=media" alt="Data Source set to Variable with Items Collection Get Tasks, and the Data Mappings for Title, Description, Icon Name, Start Date, Fields and Key Field" width="320"><figcaption><p>Variable data source on the Get Records collection, and its Data Mappings.</p></figcaption></figure>
{% endstep %}

{% step %}

### Map what each item shows

In **Data Mappings**:

* **Title**: keep `Subject`.
* **Start Date**: keep `ActivityDate` (Due Date Only).
* **Avatar** > **Icon Name**: switch the value to Manual and pick `standard:task`.
* **Fields**: add **Status** and **Priority**, so each item shows them in a details box that opens from the arrow next to the item.
* **Key Field**: leave the default `Id`. It must be unique per item.
  {% endstep %}

{% step %}

### Group by month

1. In the **Header** section, set **Title** to `Account activity`.
2. Keep **Orientation** on **Vertical**: grouping only exists in the vertical view.
3. Set **Group By** to **Month**. The latest month comes first.

Sections that open and close, and where Tasks dated in the future go, are covered in [Group a timeline by month](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/group-a-timeline-by-month.md).
{% endstep %}

{% step %}

### Save and test

Click **Done**, save the flow and run it with **Debug** on an account that has Tasks, or open it from the Account page. The timeline lists the account's Tasks under one heading per month, newest first, each with the task icon, its subject, its due date and its Status and Priority.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>The timeline shows "No results" or an illustration</summary>

The Get Records found no Task for that account. Check that `recordId` receives the account ID, and that the Tasks have the account in **Related To** (Tasks logged on a Contact only are not matched by `WhatId`). To change what the empty state shows, see [Search and filter a timeline](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/search-and-filter-a-timeline.md).

</details>

<details>

<summary>The Get_Tasks collection is not in Items Collection</summary>

Only collections are listed. In the Get Records, choose **All records** under **How Many Records to Store**, not **Only the first record**.

</details>

## Related tutorials

* [Show a record history with a query](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/show-a-record-history-with-a-query.md): the same timeline without a Get Records element.
* [Assigning multiple source collections to the Timeline](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/assigning-multiple-source-collection-to-the-timeline.md): Tasks, Events and Cases in one timeline.
* [Create a horizontal activity timeline](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/create-a-horizontal-activity-timeline.md): the same data on a horizontal date axis.
* [Perform actions on selected tasks](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/perform-actions-on-selected-tasks.md): add checkboxes and act on the ticked Tasks.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/flow/tutorials/components/timeline/display-tasks.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
