# Perform actions on selected tasks

## Overview

This page walks you through building an activity timeline component that lists selectable tasks based on a *GetRecords collection*. Then, we will display only selected tasks on another screen using the [Avonni List component](https://docs.avonnicomponents.com/flow/flow-components/list).&#x20;

## Result

The final result looks like this:

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FDzhmTcChVHhYVyxTNyZx%2FActivitiesActions.gif?alt=media&#x26;token=f4ccbc62-0532-4bea-a8e6-558b42381b6f" alt=""><figcaption></figcaption></figure>

## Steps

The steps to pass the RecordID are as follows:

### 1. Create the Get Records collection

The very first step starts with creating our Get Records collection to ask Flow Builder to fetch all the Task records by following the below steps:

* **Add a Get Records** element to fetch all tasks data
* Enter a collection Label > **GetTasks**
* Add the **Task Object**
* Select "**`None - Get all Task Records`**" in the condition requirements field
* Select "**`All Records`**" regarding the number of records to display
* Click "**Done**"

{% @arcade/embed flowId="pkdgxr21m9Pchchh1EGH" url="<https://app.arcade.software/share/pkdgxr21m9Pchchh1EGH>" %}

### 2. Add the Activity Timeline component

* **Add a screen** element
* Enter a screen label
* Drag the **Activity Timeline component** from the components list to our screen flow (located under the custom section)
* Enter an **API Name**. For example, *ActivityTimeline*.

{% @arcade/embed flowId="HEGlfWkeA1l5cOwW2nZA" url="<https://app.arcade.software/share/HEGlfWkeA1l5cOwW2nZA>" %}

### 3. Configure the Activity Timeline component

* Click on the **Open Component Builder** button to access all the settings for the Activity Timeline component
* **Enter a Title** for the component (e.g: Tasks)&#x20;
* Under the Data Source section, **select Variable** to assign our previously created Get Records collection
* Under Source Collection, **click on the GetTask collection** we created in [step 1](#1.-create-the-get-records-collection)
* Under the **Data Mapping section**, let's do our fields mapping
  * **Title** => Task.Subject
  * **Description** => Task.Description
  * **Name** => [Task.Id](http://task.id/) (Activity ID)
  * **Icon Name** => standard:task (switch to Manual to select an icon manually)&#x20;
  * **Date** => Task.DueDate
  * **Has Checkbox** => Yes (switch to Manual to select the toggle)&#x20;

{% @arcade/embed flowId="L6nSzHAeQgj8zVoUhA0H" url="<https://app.arcade.software/share/L6nSzHAeQgj8zVoUhA0H>" %}

### 4. Create a new Get Records collection to fetch selected tasks

* Add a Get record collection:
  * &#x20;**Label**: GetSelectedTasks
  * **Object**: Task
  * **Filter**: Use the **IN** operator with value “activityTimeline.selectedItemNames“

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Ff4LIlMeJz1oXP4h7dbrQ%2F2023-02-03_15-31-33.png?alt=media&#x26;token=177839c3-fc16-4d4f-bb74-a9ec5a773280" alt=""><figcaption></figcaption></figure>

### 6. Create a new flow screen&#x20;

Now, we will add a new screen flow to display only selected tasks from our first screen.

* **Add a screen** element
* Enter a screen label
* Enter an **API Name**. For example, selectedTasks
* Drag the **Avonni List Component** to our screen flow

### 7. Configure the Avonni List Component

* Open the **Component Builder** to access all Settings
* Add a bottom divider
* Select a **variable** Data Source.
* Select the **source collection** "GetSelectedTask" created in [step 4](#4.-create-a-new-get-records-collection-to-fetch-selected-tasks)
* Configure the data mapping:
  * **Label**: Subject
  * **Name**: Activitiy ID
  * **Description**: Description
  * **Avatar > Icon Name** > Manual: Standard:task2
  * **Avatar > Icon Size** > Medium
  * Add an **info** label (optional)

{% @arcade/embed flowId="ffVumlYHo7nArYrAwNcW" url="<https://app.arcade.software/share/ffVumlYHo7nArYrAwNcW>" %}

Screen:

* List component
* Display selected tasks in the list
