Flow to Send Weekly Reminder Alerts for Pending Approval Requests
Business use case:
An approval process is assigned to the step approver but but sometimes approvers don't take any action. The administrator wants to send reminder based on the frequency until user doesn't take action(either approve or Reject)
The below image shows the flow to send weekly reminder Alerts.
Basic Setup required to get started with flow configuration:
Go to Setup and type Flows in Quick find and Click on Flows.
A list of flows appears. Click on New Flow.
A new screen appears with a list of available flow types. Select Schedule-Triggered Flow and click on Next.
A flow screen with the Start element appears as shown below.
Let’s go through each component (1 to 9) of the flow.
Scheduling the flow:
Start Date: Date from which the flow will start sending reminder alerts.
Start Time: Time at which the flow will run depending on the frequency.
Frequency: Flow will run depending on the frequency. It can be Once, Daily or Weekly.
Collecting the records:
Collecting the records (here Account object is used as an example) for which we want to send the reminders. Drag and drop Get Records element from flow toolbox. Refer to below image.
Loop through each object (Account) record:
Once you collect all the records of the object (Account), Loop through each record by adding the Loop element from the flow toolbox.
Get Process Instance for each record in the loop:
Drag and drop Get Records element from flow toolbox.
Object: Select Process Instance as the object
Select filter conditions as shown the below image.
Loop through each Process Instance record:
Once you collect all the Process Instance records of each object (Account) record, Loop through each record by adding Loop element from flow toolbox.
Get Approval Request for each Process Instance record in the loop:
Drag and drop Get Records element from flow toolbox.
Object: Select Approval Request as the object
Select filter conditions as shown in below image.
Decide/Check if record is older than 7 days:
Drag and drop Decision element from flow toolbox.
Use conditions as show below.
Formula:
Go to Manager in the left-hand side of flow builder. Click on New Resource.
New Pop-up screen appears, select Formula as Resource Type.
Enter the name for formula and enter the below formula in the formula field.
MOD(VALUE(LEFT(TEXT({!Get_Approval_Requests.ElapsedTimeInDays}),FIND('.',TEXT({!Get_Approval_Requests.ElapsedTimeInDays})))),7)
Get Approver’s Email Address:
Drag and drop Get Records element from flow toolbox.
Object: Select User as the object
Select filter conditions as shown in below image.
Send Email to Approver:
Create Body of the Email Template:
Go to Manager in the left-hand side of flow builder. Click on New Resource.
New Pop-up screen appears, select Text Template as Resource Type
Enter the name for text template. Provide the verbiage as required.
Drag and drop Action element from flow toolbox.
Below screen appears, Click on Email from the list available in Left-Hand side.
Search for Send Email action in the search box. Click on Send Email.
Select configs as shown below and provide subject as required.
Final Step:
Connect all the flow elements as shown in below image.
Save the flow. Click on Activate button.
written by: Ganesh
No comments:
Post a Comment