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.

Before you start
Your screen flow has a
recordIdinput variable (Text, available for input) and runs on the Account record page. If not, follow How to pass your current RecordID in your screen flow.The account has open Tasks (Status other than
Completed).If you have never set up a Timeline, Display Tasks explains every mapping used below.
Steps
Get the account's open tasks
Add a Get Records element before the first screen.
Label it
Get Open Tasks(API nameGet_Open_Tasks). Object: Task.Conditions: Related To ID (
WhatId) Equals{!recordId}, ANDIsClosedEquals{!$GlobalConstant.False}.How Many Records to Store: All records.
No need to sort here: the Timeline orders items by Start Date itself, newest first by default.
Show the tasks on a Timeline with checkboxes
Add a Screen element labelled
Review Open Tasksand drag the Avonni Timeline onto it from the Screen components panel. Set its API Name toOpenTasksTimeline.Click Open Component Builder. In the Header section, set Title to
Open follow-ups.In Data Source, choose Variable and pick
Get_Open_Tasksin Items Collection.In Data Mappings, map Title to
Subject, Description toDescriptionand Start Date toActivityDate, and set Avatar > Icon Name tostandard:task.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.
Get the tasks the user ticked
After the screen, add a second Get Records element.
Label it
Get Selected Tasks(API nameGet_Selected_Tasks). Object: Task.Condition:
IdIn{!OpenTasksTimeline.selectedItemNames}. In the resource picker, it is Selected Item Names under theOpenTasksTimelinecomponent.How Many Records to Store: All records.
Ask the user to confirm
Add an Assignment element: a Number variable
SelectedCountEquals Count{!Get_Selected_Tasks}.Add a Screen element labelled
Confirmwith 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.
Mark the tasks Completed
Add a Loop over
{!Get_Selected_Tasks}.Inside the loop, add an Assignment:
{!Loop_Task.Status}EqualsCompleted, then add{!Loop_Task}to a Task record collection variableTasksToClose.After the loop, add Update Records: Use the IDs and all field values from a record or record collection, and select
{!TasksToClose}.
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
Related tutorials
Display Tasks: the basic Timeline setup this page builds on.
Act on a timeline item: open a flow or delete a task from a single item, without a second screen.
Search and filter a timeline: help the user find the right tasks before ticking them.
Last updated
Was this helpful?
