Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Perform actions on selected tasks

Let a user tick open tasks on a Timeline and close them all in one click, with the Selected Item Names output, Get Records and Update Records.

After a site visit at Harbor Point Logistics, a service manager has six open follow-ups on the account and wants to close the ones that are done. In this screen flow, the Avonni Timeline shows the open tasks with a checkbox on each one. The manager ticks the finished ones, clicks Next, confirms, and the flow marks them all Completed.

Avonni Timeline listing six open tasks of Harbor Point Logistics, each with a checkbox, two of them ticked
Each open task has a checkbox, and the ticked ones go to the next screen.

Before you start

Steps

1

Get the account's open tasks

Add a Get Records element before the first screen.

  1. Label it Get Open Tasks (API name Get_Open_Tasks). Object: Task.

  2. Conditions: Related To ID (WhatId) Equals {!recordId}, AND IsClosed Equals {!$GlobalConstant.False}.

  3. How Many Records to Store: All records.

No need to sort here: the Timeline orders items by Start Date itself, newest first by default.

2

Show the tasks on a Timeline with checkboxes

  1. Add a Screen element labelled Review Open Tasks and drag the Avonni Timeline onto it from the Screen components panel. Set its API Name to OpenTasksTimeline.

  2. Click Open Component Builder. In the Header section, set Title to Open follow-ups.

  3. In Data Source, choose Variable and pick Get_Open_Tasks in Items Collection.

  4. In Data Mappings, map Title to Subject, Description to Description and Start Date to ActivityDate, and set Avatar > Icon Name to standard:task.

  5. Has Checkbox starts as a field picker. Click the mode icon at the right of its label to turn it into a toggle, then switch the toggle on: every item gets a checkbox. Leave Key Field on its default, Id.

The Key Field matters here: it is the value the Timeline returns for each ticked item. With Id, you get Task IDs, which is exactly what the next Get Records needs.

3

Get the tasks the user ticked

After the screen, add a second Get Records element.

  1. Label it Get Selected Tasks (API name Get_Selected_Tasks). Object: Task.

  2. Condition: Id In {!OpenTasksTimeline.selectedItemNames}. In the resource picker, it is Selected Item Names under the OpenTasksTimeline component.

  3. How Many Records to Store: All records.

The component also returns Selected Items, the ticked records themselves. It holds only the fields the first Get Records fetched, so the second Get Records is the safer source for an update.

4

Ask the user to confirm

  1. Add an Assignment element: a Number variable SelectedCount Equals Count {!Get_Selected_Tasks}.

  2. Add a Screen element labelled Confirm with a Display Text: {!SelectedCount} task(s) will be marked Completed. Click Finish to confirm.

This is the second screen of the flow. A user who clicks Previous gets back to the Timeline.

5

Mark the tasks Completed

  1. Add a Loop over {!Get_Selected_Tasks}.

  2. Inside the loop, add an Assignment: {!Loop_Task.Status} Equals Completed, then add {!Loop_Task} to a Task record collection variable TasksToClose.

  3. After the loop, add Update Records: Use the IDs and all field values from a record or record collection, and select {!TasksToClose}.

6

Save and test

Click Done, save and activate the flow, and add it to the Account record page. Open Harbor Point Logistics: the Timeline lists the open tasks, each with a checkbox. Tick two, click Next: the Confirm screen reads 2 task(s) will be marked Completed. Click Finish, then reopen the flow: the two tasks are gone from the list, because they are now Completed.

Troubleshooting

No checkbox appears on the items

Has Checkbox is still a field picker, or its toggle is off. Click the mode icon next to its label and switch the toggle on.

Get Selected Tasks returns nothing
  • The user did not tick anything before clicking Next. Add a Decision after the Get Records to handle an empty selection.

  • Key Field was changed from Id, so Selected Item Names holds something other than Task IDs. Set it back.

Last updated

Was this helpful?