> 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/act-on-a-timeline-item.md).

# Act on a timeline item

Let users log a call outcome, plan a follow-up or delete a task straight from a Timeline item, with item actions and click interactions.

A service manager reviewing Harbor Point Logistics sees a call from last week that never got an outcome. Instead of leaving the flow to find the task, they click it: a side panel opens to log the result. Each item also carries a menu with two actions: one plans a follow-up in a dialog, the other deletes the task.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F9T9tXCbfGwAvFq2oXzjK%2Ftimeline-act-on-a-timeline-item-result.png?alt=media" alt="Timeline of account tasks with a menu button on each item and a side panel open to log the outcome of the clicked Debrief call" width="900"><figcaption><p>Clicking a task opens a side panel to log its outcome.</p></figcaption></figure>

## Before you start

* Your screen flow has a `recordId` input variable and runs on the Account record page. If not, follow [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).
* Two small screen flows exist and are active, each with a Text input variable `recordId` (available for input):
  * `Log_Task_Outcome` gets the Task by `recordId`, shows its **Status** and **Comments**, and updates it.
  * `Plan_Follow_Up` creates a new Task whose `WhatId` is `recordId`.

## Steps

{% stepper %}
{% step %}

### Load the tasks with a Query

1. Add a Screen element and drag the **Avonni Timeline** onto it. Click **Open Component Builder**.
2. In **Data Source**, choose **Query**. Set **Object API Name** to `Task`.
3. Under **Filters**, click **Add Condition**: the task's **Related To ID** (`WhatId`) Equals your `recordId` resource.
4. In **Data Mappings**, map **Title** to `Subject`, **Description** to `Description` and **Start Date** to `ActivityDate`.

Query rather than Variable: after the panel or dialog closes, a **Refresh Query** reloads the items. A Variable source keeps showing what the Get Records returned when the screen opened. [Show a record history with a query](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/show-a-record-history-with-a-query.md) covers the query in detail.
{% endstep %}

{% step %}

### Add two actions to every item

1. In the **Properties** tab, open the **Item Actions** section and add an entry to **Actions**.
2. First action: **Label** `Plan follow-up`, **Name** `follow_up`, **Icon Name** `utility:event`.
3. Second action: **Label** `Delete`, **Name** `delete`, **Icon Name** `utility:delete`.

The **Name** is what the interactions use to tell the actions apart. Keep it short and without spaces.
{% endstep %}

{% step %}

### Open a side panel when an item is clicked

1. Open the **Interactions** tab and add an **Item Click** interaction.
2. **Type**: **Open Flow Panel**. **API Name**: `Log_Task_Outcome`.
3. Under **Input Variables**, add one: **Name** `recordId`, **Type** **Text**, **Value** `{{Record.Id}}`.
4. Set **Header** to `{{Record.Subject}}`.
5. Under **On Finish**, add **Refresh Query**.

As soon as **Item Click** has an interaction, each item title becomes a link, and the clicked item stays highlighted while the panel is open.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FeMenUCP2blCo3od0IkNd%2Ftimeline-act-on-a-timeline-item-interactions.png?alt=media" alt="Interactions tab of the Timeline with the Item Click Open Flow Panel entry open beside two Item Action Click entries" width="600"><figcaption><p>Item Click opens the panel, and each item action has its own interaction.</p></figcaption></figure>
{% endstep %}

{% step %}

### Open a dialog from the Plan follow-up action

1. Add an **Item Action Click** interaction. In **Target Name**, pick **Plan follow-up** (the list shows the actions by label).
2. **Type**: **Open Flow Dialog**. **API Name**: `Plan_Follow_Up`.
3. Under **Input Variables**: **Name** `recordId`, **Type** **Text**, **Value** `{{Record.WhatId}}`, the account the task belongs to.
4. Set **Modal Header** to **Custom** and type `Plan a follow-up`. Under **On Finish**, add **Refresh Query**.
   {% endstep %}

{% step %}

### Delete the task from the Delete action

1. Add a second **Item Action Click** interaction. In **Target Name**, pick **Delete**.
2. **Type**: **Delete Selected Record(s)**.
3. Optional: under its **On Success**, add a **Show Toast** that says `Task deleted`.

On an item action, **Delete Selected Record(s)** deletes the task the action belongs to, not the ticked ones. **Delete Selected Record(s)**, **Duplicate Selected Record(s)** and **Edit Selected Record(s)** are offered only with a **Variable** or **Query** data source, and on **Item Action Click** and **Header Action Click**, never on **Item Click**.
{% endstep %}

{% step %}

### Save and test

Click **Done**, save and activate the flow, and add it to the Account record page. Open Harbor Point Logistics.

* Click a task title: a panel titled with the task's subject opens with `Log_Task_Outcome`. Finish it: the Timeline reloads with the new status.
* Open an item's menu and click **Plan follow-up**: a dialog opens. Finish it: the new task appears on the Timeline.
* Open an item's menu and click **Delete**: the task is deleted and disappears from the Timeline.
  {% endstep %}
  {% endstepper %}

## Troubleshooting

<details>

<summary>I cannot find the actions on a horizontal timeline</summary>

In the **Horizontal** orientation, the item menu sits in the item's popover. Hover the item, then open the menu next to the close button.

</details>

<details>

<summary>Delete fails with "insufficient access rights on object id"</summary>

The delete runs as the user running the flow, with their permissions and sharing. A user who cannot delete the task in Salesforce cannot delete it from the Timeline either. Grant access, or leave the **Delete** action out for those users.

</details>

<details>

<summary>The panel opens, but the flow inside does not know which task was clicked</summary>

* The input variable **Name** must match the child flow's variable exactly (`recordId`), and that variable must be available for input.
* The **Value** must be `{{Record.Id}}`, with the double braces.

</details>

<details>

<summary>The Timeline does not show the change after the panel closes</summary>

**Refresh Query** is missing under **On Finish**, or the Timeline uses a **Variable** data source, which **Refresh Query** cannot reload.

</details>

## Related tutorials

* [Perform actions on selected tasks](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/perform-actions-on-selected-tasks.md): act on several ticked tasks at once instead of one item.
* [Show a record history with a query](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/show-a-record-history-with-a-query.md): the Query data source this page relies on.
* [Search and filter a timeline](https://docs.avonnicomponents.com/flow/tutorials/components/timeline/search-and-filter-a-timeline.md): find the item before acting on it.


---

# 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/act-on-a-timeline-item.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.
