> 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/list/build-a-checklist-that-saves.md).

# Build a Checklist That Saves

Show a sales rep's open Tasks as a checklist on a flow screen and complete every ticked Task in Salesforce when the rep moves on.

A sales rep starts the day with eight follow-up tasks: send a quote, confirm a rollout date, book a training session. You want them on one flow screen as a checklist the rep ticks off, and you want every tick to complete the Task in Salesforce. The List's **Check List** variant draws the checkboxes and the flow saves them.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FZ7LcmuWp0hVVyugGBG6G%2Flist-build-a-checklist-that-saves-result.png?alt=media" alt="A checklist of eight follow-up tasks with due dates and priorities, two of them ticked and crossed out, and a counter showing two of eight done" width="320"><figcaption><p>Ticked tasks are crossed out and locked, and the counter shows how many are done</p></figcaption></figure>

## Before you start

* A Screen Flow with the Avonni Flow Components package installed. If the List is new to you, read the [List](https://docs.avonnicomponents.com/flow/flow-components/list.md) reference first.
* The running user can edit the Tasks the flow shows.

## Steps

{% stepper %}
{% step %}

### Get the rep's Tasks

1. Add a **Get Records** element. **API Name**: `Get_My_Tasks`.
2. **Object**: Task. Add the condition `OwnerId` **Equals** `{!$User.Id}`.
3. **Sort Order**: Ascending, **Sort By**: `ActivityDate`, so the most urgent task comes first.
4. **How Many Records to Store**: All records. **How to Store Record Data**: Automatically store all fields.
   {% endstep %}

{% step %}

### Add the List to a screen

1. Add a **Screen** element after `Get_My_Tasks` and drag the Avonni **List** onto it. Give the component the API name `TaskChecklist`.
2. Click **Open Component Builder**.
3. In the **Properties** tab, set the **Data Source** to **Variable** and pick `{!Get_My_Tasks}`.
4. In the **Header** group, set the **Title** to `Today's follow-ups`.
   {% endstep %}

{% step %}

### Map the Task fields

In **Data Mappings**:

* **Label**: already filled with `{{Record.Subject}}` for a Task. Keep it.
* **Fields**: add **Due Date Only** and **Priority**. They show under each task, with the date in the rep's own format.
* **Checked**: **Closed** (`IsClosed`). Tasks that are already completed open ticked.
* **Uncheckable**: **Closed** (`IsClosed`) as well. Pointing both mappings at the same field is deliberate: a completed task cannot be unticked, and a task the rep ticks locks at once, so nobody reopens a finished task by mistake from this screen.

If you would rather let the rep undo a tick before leaving the screen, leave **Uncheckable** empty.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FrX3lzbi8VG4hzSkwlOcB%2Flist-build-a-checklist-that-saves-mappings.png?alt=media" alt="The List&#x27;s Data Mappings in the Component Builder with Label set to Subject, Checked and Uncheckable both set to Closed, and Due Date Only and Priority as Fields" width="480"><figcaption><p>Checked and Uncheckable both read the Closed field</p></figcaption></figure>
{% endstep %}

{% step %}

### Turn the list into a checklist

1. Set **Variant** to **Check List**. A **Check List** group appears under it.
2. Turn on **Strike Through On Check**, so ticked tasks are crossed out.
3. Turn on **Show Check Counter**, so the rep sees how many tasks are ticked out of the total.
   {% endstep %}

{% step %}

### Complete the ticked Tasks

The List hands every ticked item to the flow in its **Selected Items** output, as Task records. The flow sets their status and saves them.

1. Create a record collection variable `TasksToComplete` (**Data Type**: Record, **Allow multiple values (collection)**, **Object**: Task).
2. After the screen, add a **Loop** element `Loop_Checked_Tasks` over `{!TaskChecklist.selectedItems}` (in the resource picker: `TaskChecklist` > **Selected Items**).
3. Inside the loop, add an **Assignment** element `Mark_Completed`:
   * `{!Loop_Checked_Tasks.Status}` **Equals** `Completed`
   * `{!TasksToComplete}` **Add** `{!Loop_Checked_Tasks}`
4. After the last item, add an **Update Records** element `Update_Tasks`: **Use the IDs and all field values from a record or record collection**, and pick `{!TasksToComplete}`.

**Selected Items** also holds the tasks that were already completed when the screen opened, since they open ticked. Setting them to `Completed` again changes nothing.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FVccH57HBuN3iNffeAxwX%2Flist-build-a-checklist-that-saves-flow.png?alt=media" alt="Flow Builder canvas showing Get Records, a screen, a Loop with an Assignment inside, and an Update Records element" width="480"><figcaption><p>The loop marks each ticked Task Completed and one Update Records element saves them all</p></figcaption></figure>
{% endstep %}

{% step %}

### Save and test

1. Save the flow and click **Debug**, or activate it and run it.
2. Tick two tasks. Each one is crossed out, locks, and the counter goes up by one.
3. Click **Next**, then open one of the two Tasks: its **Status** is `Completed`.
4. Run the flow again. The two tasks open ticked and cannot be unticked.
   {% endstep %}
   {% endstepper %}

{% hint style="info" %}
**Save each tick the moment it happens.** When the records have a writable checkbox (a custom `Done__c` on a project milestone, for example), map **Checked** to it and add an **Item Check** interaction of type **Update Record(s)** in the **Interactions** tab. Each tick then saves at once, with no Loop. `IsClosed` cannot be used this way: Salesforce derives it from the Task status.
{% endhint %}

## Troubleshooting

<details>

<summary>The ticks are gone the next time the flow runs</summary>

The List only remembers ticks while the screen is open. Something has to save them: the Loop and **Update Records** above, or the **Update Record(s)** interaction from the hint. Check also that **Checked** is mapped, or the saved state never comes back as a tick.

</details>

<details>

<summary>The rep cannot untick a task</summary>

**Checked** and **Uncheckable** point at the same field, which locks an item as soon as it is ticked. This tutorial does it on purpose. Leave **Uncheckable** empty if the rep must be able to change their mind before clicking **Next**.

</details>

<details>

<summary>The Update Record(s) type is missing from the Item Check interaction</summary>

It appears only when **Variant** is **Check List** and the **Data Source** is **Variable** or **Query**. A Manual list has no records to update.

</details>

<details>

<summary>Selected Items comes back empty or with the wrong records</summary>

Each item is matched back to its record through the **Key Field** mapping, `{{Record.Id}}` by default. Keep that default unless you have a field that is unique on every record.

</details>

## Related tutorials

* [Search, Filter and Paginate a List](https://docs.avonnicomponents.com/flow/tutorials/components/list/search-filter-and-paginate.md): keep a long checklist usable with search and pages.
* [Act on a Row](https://docs.avonnicomponents.com/flow/tutorials/components/list/act-on-a-row.md): add buttons to each task and branch the flow on the one clicked.
* [How to Reorder Items and Update Records](https://docs.avonnicomponents.com/flow/tutorials/components/list/how-to-reorder-items-and-update-records.md): the same idea for order, saved when users drag items.


---

# 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/list/build-a-checklist-that-saves.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.
