Power Automate to send reminders for tasks

In this blog post, we will explore how to use Power Automate to send reminders for tasks 7 days before the due date, on the due date, and every 7 days after until the task status is marked as completed.

Prerequisites:

  • Create SharePoint List and name it as ‘TaskList’
  • Add columns as below

Step-by-Step procedure to create a flow:

Step 1: Set Up Recurrence

The first step is to configure a recurring trigger in Power Automate. This trigger will run the flow every day, serving as the foundation for sending timely reminders for tasks.

Log into Power Automate Portal > Create > Scheduled Cloud flow

Give Flow Name > Set Repeat Every Field with ‘1’ and ‘Day’

Step 2: Fetch In-Progress Tasks

Next, use the “Get items” action to retrieve tasks from your SharePoint task list. Apply a filter to include only tasks with the status “In Progress” and with a due date that is within the next 7 days. This filtering ensures that reminders are sent for tasks that are currently being worked on and due soon.

Click ‘+’ icon > Add an action > Get Items > Change the title > Select Site Address > Select List > Write Filter Query : (TaskStatus eq ‘Inprogress’) and (DueDate le ‘addDays(utcNow(),7)’)

Step 3: Initialize Variable for Due Date

Now, create a variable (let’s call it varDueDate) to store the due date for each task.

Click ‘+’ icon > Add an action > Initialize variable > Change the title > Set Name and Type

Step 4: Loop Through In-Progress Tasks

Use a loop to iterate through each “In Progress” task. This loop will enable you to perform actions on each task individually.

Click ‘+’ icon > Add an action > Apply to Each > Change the title > Select Dynamic value

Click ‘+’ icon > Add an action >Set Variable > Select varDueDate > Fill Dynamic value ‘DueDate’

Step 5: Calculate the Number of Days remaining until the task is due.

Within the loop, add a “Compose” action to calculate the number of days remaining until the task is due. Use the formula: div(sub(ticks(utcNow()), ticks(variables('varDueDate'))), 864000000000). This will calculate the difference in days between the current date and the task's due date.

Click ‘+’ icon > Add an action > Compose > give name > Inputs: div(sub(ticks(utcNow()), ticks(variables('varDueDate'))), 864000000000)

Step 6: Apply Mod Arithmetic

Following the “Compose” action, add another “Compose” action to perform mod arithmetic. Use the formula: mod(outputs('Compose_number_of_days'), 7). This will determine if the number of days left until the due date is a multiple of 7.

Click ‘+’ icon > Add an action > Compose > give name > Inputs: mod(outputs('Compose_number_of_days'), 7)

Step 7: Check for Reminder Days

Next, add a “Condition” action to check if the result of the mod arithmetic equals 0. If true, it means that the task is either due in 7 days (7 days before the due date) or overdue by a multiple of 7 days. This is the trigger point to send the reminder.

Click ‘+’ icon > Add an action > Condition >

Step 8: Send the Reminder

Within the “Condition” action, add an “Email” action to send the task reminder to Approver. The email content should include essential details about the task, such as its name, due date, and status.

Click ‘+’ icon > Add an action > Send an email (V2) > To : Approver Email > Give Subject > Body: essential details

Step 9: Loop Continuation

After sending the reminder, the loop will continue to the next “In Progress” task. The flow will keep looping through all tasks until all relevant reminders have been sent.

Final flow look like this:

Conclusion:

With Microsoft Power Automate, you can revolutionize your task management by setting up an automated task reminder system that guarantees no deadlines are overlooked. The flow will promptly send reminders 7 days before the due date, on the due date, and every 7 days thereafter until the task is marked as completed.

Comments

Popular posts from this blog

Integrating ServiceNow with Power Automate via REST API

Validate Email Format in Power Automate Using Custom Connector and Regex in C#

How to Check Null Values in Power Automate Filter Query