> 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/group-a-timeline-by-month.md).

# Group a timeline by month

Group a vertical Timeline by day, week, month or year, with sections that open on click and a separate group for upcoming activities.

A service manager preparing a call with Harbor Point Logistics opens a Screen Flow and sees two months of calls, emails and follow-ups in one long list. Grouping the **Avonni Timeline** by month turns that list into short sections ("October 2026", "November 2026") and puts everything still to come in its own **Upcoming** group at the top.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FIeSrx6gsi36OZMDmQwCQ%2Ftimeline-group-a-timeline-by-month-result.png?alt=media" alt="Avonni Timeline of Harbor Point Logistics tasks split into Upcoming, November 2026 and October 2026 sections"><figcaption><p>Activities grouped by month, with upcoming items in their own group.</p></figcaption></figure>

## Before you start

* A Screen Flow with the **Avonni Timeline** component already showing the account's Tasks. [Display Tasks](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/display-tasks.md) builds it.
* The **Start Date** data mapping points to a date field (for example `ActivityDate` on Task). Groups are built from that date.

## Steps

{% stepper %}
{% step %}

### Keep the Timeline vertical

Grouping only exists in the vertical layout.

* Select the **Avonni Timeline** on the screen and click **Open Component Builder**.
* In the **Properties** tab, check that **Orientation** is set to **Vertical**.

If **Orientation** is **Horizontal**, the **Group By** setting is hidden.
{% endstep %}

{% step %}

### Choose how items are grouped

* In **Group By**, select **Month**.

Each option gives a different section title:

| Group By  | Section title example |
| --------- | --------------------- |
| **Day**   | `November 03, 2026`   |
| **Week**  | `Week: 45, 2026`      |
| **Month** | `November 2026`       |
| **Year**  | `2026`                |

Items with no **Start Date** value land in a group named `Others`.
{% endstep %}

{% step %}

### Let users open and close the groups

* Turn on **Collapsible**. Each group title gets a chevron the user can click.
* To start with every group closed, also turn on **Closed**. The user then opens only the month they care about.

{% hint style="info" %}
**Closed** only works together with **Collapsible**. With **Collapsible** off, every group stays open whatever **Closed** says.
{% endhint %}
{% endstep %}

{% step %}

### Decide where future activities go

By default, any item dated after today goes into a group named **Upcoming**, whatever its month. Next week's follow-up calls sit there together, apart from the history.

* To file future items under their own month instead, turn on **Disable Upcoming Group**.
  {% endstep %}

{% step %}

### Pick the order

* In **Sorted Direction**, keep **Descending order** to show the most recent activities first, or choose **Ascending order** to read the account history from the oldest item.
  {% endstep %}

{% step %}

### Save and test

* Click **Done**, save the flow and run it with an account that has activities.
* With **Month**, **Collapsible** and **Closed** on, the Timeline shows one closed section per month plus **Upcoming**. Click **November 2026**: its items open under the title.
  {% endstep %}
  {% endstepper %}

## Troubleshooting

<details>

<summary>The Group By setting is missing</summary>

**Orientation** is set to **Horizontal**. Set it to **Vertical**: **Group By**, **Collapsible**, **Closed** and **Disable Upcoming Group** only appear in the vertical layout.

</details>

<details>

<summary>Closed is on, but every group is open</summary>

**Collapsible** is off. Turn it on: a group can only start closed if the user can open it.

</details>

<details>

<summary>Most items end up in Upcoming</summary>

The **Start Date** mapping points to a date in the future, such as the due date of open Tasks. Either map a past date (for example `CreatedDate`) or turn on **Disable Upcoming Group** so future items are grouped by their own month.

</details>

<details>

<summary>Some items are grouped under Others</summary>

Those records have no value in the field mapped to **Start Date**. Fill the field on the records, or filter them out in the Get Records element.

</details>

## Related tutorials

* [Display Tasks](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/display-tasks.md): build the Timeline this page groups.
* [Format dates on a Timeline](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/customizing-date-format-in-the-timeline-component-using-luxon.md): change how the date of each item reads inside the groups.
* [Create a horizontal activity timeline](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/create-a-horizontal-activity-timeline.md): the other layout, for scanning a period at a glance.
* [Timeline](https://docs.avonnicomponents.com/flow/flow-components/timeline.md): every setting of the component.


---

# 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/group-a-timeline-by-month.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.
