When using the User Task wizard in the workflow designer, the developer has the option to utilize multiple task groups to control what AAD users and/or SharePoint groups are assigned the task. These task groups can further be configured with conditional statements so that the members of the task group are only assigned the user task if certain conditions are met. This article discusses an example use case of task groups.
Scenario example: Manager approval based on a single parameter
Abstract: An item/form submission is submitted for a manager's approval, and which manager it is sent to depends on a single parameter (e.g., under/over a certain budget in an expense claim, type of document submitted, leave request based on type of leave taken, etc.).
In this scenario, I will use the example of a business invoice with a budget threshold set at $5000. If the cost of the invoice is under $5000, only the direct manager's approval is necessary. If it is equal to or over $5000, then it must also be approved by the CFO. Two task groups are created, one containing the direct manager of the submitter, the other containing the CFO (note the first is a dynamic entry, while the entry for the CFO is a static AAD user).
The first task group containing the manager of the submitter will always receive the task, so no additional rules are necessary for this group.
For the CFO task group, however, a conditional statement must be created so the User Task is only sent to this individual if the invoice is equal to or over $5000. The invoice parameter comes from the submission of the form, and a simple comparison is done to check the value.
In the case where the invoice equal to or over $5000, approval is needed from both the manager of the submitter as well as the CFO, so a line rule must also be created: