The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Create approval records for all tasks

Ash33
Tera Expert

Hi experts,

 

Can someone guide me how to create approval records at once for all change tasks in flow designer?

Im doing a lookup > for each > Ask for approval, but this creates approval records sequentially. My requirement is to do a lookup on all change tasks associated with the change request, and then create approval records assigned to the change_task.assignment_group.manager.

For example. if there is 2 change task assigned to group "ABC" and "XYZ", then create 2 approval records and the approvers need to be the "MANAGER" of group "ABC" and "XYZ".

1 REPLY 1

Ajay_Chavan
Kilo Sage
Parallel Subflow Approach

Step 1: Create Subflow "Create Change Task Approval"
Subflow Configuration:
Go to: Flow Designer > Subflows
Click: New
Name: Create Change Task Approval
Description: Creates approval for individual change task
Subflow Input Variables:
Variable 1:

Name: change_task_record
Type: Reference
Table: Change Task [change_task]

Variable 2:
Name: approver_user
Type: Reference
Table: User [sys_user]


Subflow Action:

Add: Ask for Approval action

Configure:

Record: change_task_record (from input)
Approver: approver_user (from input)
Approval Field:  LEAVE COMPLETELY EMPTY
Wait for Completion: true
Short Description: Approval required for Change Task



Step 2: Main Flow Configuration

Flow Steps:
1. Lookup Records
Table: Change Task [change_task]
Condition: change_request = [your change request sys_id]
Return: All matching records

2. Do the following in parallel
Add: Flow Logic > Do the following in parallel

3. For each (inside parallel)
Add: Flow Logic > For each
List: Change Task records from step 1 lookup
Item Label: Current Change Task

4. Call Subflow (inside for each)
Add: Action > Subflow > Create Change Task Approval
Configure Inputs:
change_task_record: Current Change Task (from for each)
approver_user: Current Change Task > Assignment Group > Manager




Complete Flow Structure:
Main Flow
├── 1. Lookup Records (Change Tasks)
├── 2. Do the following in parallel
    └── 3. For each Change Task
        └── 4. Call Subflow: Create Change Task Approval
            ├── change_task_record: Current Change Task
            └── approver_user: Current Change Task.Assignment Group.Manager

Subflow: Create Change Task Approval
└── Ask for Approval
    ├── Record: change_task_record (input)
    ├── Approver: approver_user (input)  
    └── Approval Field: [EMPTY] 



Glad I could help! If this solved your issue, please mark it as Helpful and Accept as Solution so others can benefit too.*****Chavan A.P. | Technical Architect | Certified Professional*****