Applies to version: 2021.1.x and above; author: Konrad Wojtycza
WEBCON BPS 2021 introduces the new SELECT VALUES function that allows you to retrieve data from a selected item list column. This function enables saving data from all rows of a given column in a form field indicated in the configuration. Data are saved as a collection separated by semicolons. The function ignores empty values.
In this article, we will copy values from the item list to the “Approvers to notify” form field. In this field, we select people who will receive a notification about an instance to be approved.
Fig. 1. The SELECT VALUES function in the expression editor
As you can see below, users copied to the “Approvers to notify” form field will receive an e-mail notification at the “Approve” step. A person who fills out the Analytical breakdown list can decide to whom the notification will be sent by deleting people automatically added to this form field.
Fig. 2. Users in the "Approvers to notify" form field are dynamically filled out based on the value in the Analytical breakdown list
Fig. 3. Sample e-mail notification
We will present the configuration and operation of the SELECT VALUES function on the Analytical breakdown item list.
Fig. 4. The Analytical breakdown item list
In the configuration of the Analytical breakdown item list, we have added rules using the SELECT VALUES functions in the “Form rule invoked after callback” window. The first rule sets the value of the “Person/group” choice field - “Approvers to notify”. Values from the “Approver” column are copied to the “Approvers to notify” field. The second rule sets the value of the “Account numbers” field based on the “Account number” item list column.
Fig. 5. Configuration of rules using the SELECT VALUES functions
SELECT VALUES [Item List] [Column]
To dynamically fill out the “Approvers to notify” and “Account numbers” fields, check the “Invoke callback rules on value change” option on the “Approver” column of the item list.
Fig. 6. Callback on Approver column
The "Account number" and “Approver” columns are filled out automatically based on the value selected in the "Account name" column. If there is a single row on the item list, single values will be transferred to both of the form fields.
Fig. 7. The analytical breadown item list with a single row
Fig. 8. Fields filled wih the SELECT VALUES function
If there is more than one row on the item list, the transferred values are separated by semicolons (the function ignores empty values).
Fig. 9. The Analytical breakdown item list with three rows
Fig. 10. The completed "Account numbers" and "Approvers to notify" fields
If there are duplicate values on the item list (as in the screenshot below), then in the “Approvers to notify” user Alicja Kasacja will appear twice. However, after refreshing the form, they will only be visible one – this form field is the Person/Group choice field.
Fig. 11. Item list with duplicated rows
The SELECT VALUES function significantly facilitates retrieving values from item lists directly on the form. This function will be helpful wherever the values entered on the item list are used in other fields of the form, or they determine which path the instance will follow.