Skip to main content

Selection task

Use the Selection task step to have a user or a group choose one or more rows from a list – records, or plain values – and continue with what they chose. The flow waits until the task is completed – for hours or days if need be. How users, groups, the inbox and the waiting work is described in AutoFlow Tasks.

Typical use cases:

  • Find records lists the open purchase orders of a vendor; the buyer picks the ones to release, and a For each loop releases them.
  • A list of possible delivery dates comes from a web service; the sales assistant picks one.
  • Several contacts match an incoming e-mail; someone from the service team picks the right one.

Configure the step​

Description​

The step's label on the canvas – and the subject of the task in the inbox, so name it like the task: Choose orders to release.

Instructions​

What the person should choose, and why – shown above the list on the task card. SmartFields are resolved when the task is created.

Assign to​

User, Task group or User who started the flow.

User who started the flow gives the task to the user the flow runs as – useful in a flow you start yourself, to let you pick what the flow works on next. While you follow the flow in its progress dialog, completing the task needs no license at all. If the flow runs in the background, or you close the task and complete it later from the inbox, you need an AutoFlow Tasks seat like for any other selection task.

Assignee​

Shown for User and Task group: the user name or the task group code. Pick one with the lookup, type it, or insert a SmartField that holds it. An unknown or disabled user stops the flow with an error. Completing a selection task needs an AutoFlow Tasks seat – the step's status line warns you when the assignee has none, or when nobody in the group has one.

Choose from​

The list to choose from, as a SmartField:

  • Records – a reference, an array of references or an iterable, for example the results of Find records. Every record becomes a row. Table shows which table the records come from.
  • Values – a list of values, for example from the Parser. Every value becomes a row; a value that appears twice is two rows.

AutoFlow sees which of the two you picked and offers the matching settings below.

Multiple selection​

Off: the person chooses exactly one row. On: they can choose as many as they like, with Select all shown for the rows the search currently shows.

If the list is empty​

When the list has no rows, no task is created. Fail the step stops the flow with an error; Continue with no results carries on with count = 0.

Due date​

Optional. A date, or a SmartDate such as [@calc({{today}}, "+5D")@]. Overdue tasks are highlighted in the inbox, and users can get reminders and digests.

Columns (records)​

What the list shows for each record: a Caption for the column heading and a Value – SmartText that starts with the list, for example {{find_results.No}} and {{find_results.Description}}. The value can mix in other SmartFields and text, as long as it uses the list. Without columns, the list shows each record's primary key.

Column caption (values)​

The heading above the values. Empty: the name of the list.

The task card​

The card shows the instructions and the list, with a search box that filters the rows on every column. Clicking a row chooses it; with multiple selection, clicking it again un-chooses it. The icon at the end of a record row opens the record's card, so the person can check it before choosing. Complete becomes available as soon as a row is chosen.

The rows show the values from the moment the task was created. If a record was deleted in the meantime, its row is greyed out and cannot be chosen.

A task holds at most 1,000 rows. If the list is longer, the task gets the first 1,000, and both the card and the execution log say how many rows the list had – narrow the list down in the step before, for example with a filter in Find records.

Outputs​

OutputContent
resultsthe chosen rows: for records a reference – results is the first, results[0], results[1], … are all of them, in list order, just like the results of Find records; for values the values themselves
counthow many rows were chosen
completedBywho completed the task
taska reference to the task itself – for example to link it to the document or to report on it

To work through every chosen record, put a For each loop over results after the step. To list the chosen rows in a text – an e-mail, say – use a {#for #} block over {{results}}; it works for records and for values.

Where the step is available​

The step is not available in flows that cannot wait for a person – the Document and Page triggers, the report triggers and sub-flows – see How a flow waits.