web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send Emails Based on t...
Power Automate
Suggested Answer

Send Emails Based on the Task Order

(1) ShareShare
ReportReport
Posted on by 97
I have an app that uses SharePoint as its backend. 
 
I have an Action Items list (parent list) and an associated Tasks items list (child list). Each Action Item can have many Tasks associated.
 
In the Tasks list, I have a Task Order column which should be the order each task is completed in. The tasks are all entered at the same time when the Action Item is input, and the user picks the task order 1-n.
 
I am not sure how to get started. I want a workflow that only sends a task notice to the first task. When that task is finished, the workflow should send an email to the next one in order based on the Action Item ID and the Task Order. So basically, the workflow has to wait around for first task to complete or reject before it goes on to the next task.

Below is my Tasks list and show the task order (disregard the funny due dates, this is test data).
 
 
 
Categories:
I have the same question (0)
  • David_MA Profile Picture
    14,689 Super User 2026 Season 1 on at
    I am not positive about this, but I think I would have two workflows. However, I need to ask this first, do all of the related tasks of an action item have the same Action ID? In your screen shot, there are three tasks for Action ID 5. If so:
     
    Workflow 1:
    • Add a trigger condition to check that task order eq 1 and status ne Completed.
      • Even better would be where status eq null and the workflow sets it to In Progress so it cannot trigger again.
    • This flow starts the first notification.
    Workflow 2:
    • Add a trigger condition where Status eq Completed
    • You'll need to have some other trigger condition so the flow cannot trigger again. 
      • Maybe you add another column named next task and leave it empty (null).
      • Then your trigger would be Status eq Completed and NextTask eq null
    • When the flow runs, you use a get items with the following filter query:
      • ActionID eq action ID of the current item and TaskOrder eq current item task order value plus 1
      • Be sure to update the NextTask field with either the next task order number, completed, or something of your choice so the flow cannot trigger again if the item is updated after it has been completed.
    • Then you can use a length expression to make sure 1 item is returned.
    • If so, use an apply to each on the items returned from the get items action to send the next notification.
    • When all of the tasks are completed, the last task will return no items.
     
    Hopefully the above makes sense.
  • FW-07051511-0 Profile Picture
    97 on at
     
    You are correct, each action item can have multiple tasks and those tasks will have the same action ID.

    I will try to iterate through your recommendations but I am going on vacation so it will be at least a week before I discover if it works out. 
  • Suggested answer
    11manish Profile Picture
    2,484 on at
    Your design is actually good already:
    • Parent list = Action Items
    • Child list = Tasks
    • Task Order controls sequence
    You just need a flow that:
    • Starts with Task Order = 1
    • Waits for completion/rejection
    • Finds the next task in sequence
    • Sends notification
    • Repeats until no tasks remain
    The best approach is:
    • Two event-driven Power Automate flows
    rather than one long waiting workflow.
     
    This is the standard enterprise pattern for:
    • approvals
    • sequential tasks
    • workflow routing
    • stage progression
    and works very well with SharePoint-based applications.
  • FW-07051511-0 Profile Picture
    97 on at
    @David_MA and @11manish

    I just ran into my first challenge. The person loading the action item could assign all tasks with an order number of 1.

    Assume there are two tasks for an action item 5 and each task had an order number of 1. This capability is possible to allow for either serial or parallel task actions. 

    It could be possible, for example to have an order like this.
     
    1
    2
    2
    3
    4
     
    This means task order number one must complete before the two tasks with order number two fire in parallel, then three goes, then four goes.

    I purposeful designed it this way without thought of how challenging the workflow was going to be to control it all. 
     
    The first workflow trigger on when task item is created will work as @David_MA pointed out. But collecting multiple items for order number two will result in two when item is modified workflows firing causing two emails to go out to each person. I might have to figure out how to incorporate a help list into this scenario.
  • Suggested answer
    Valantis Profile Picture
    5,581 on at
     
    The parallel task order problem is solvable with a tracking column approach. You're right that multiple "when item modified" triggers will fire independently causing duplicate emails.
     
    The fix: add a Status column to your Tasks list (e.g. Pending, In Progress, Complete, Rejected). The flow logic becomes:
    Flow 1 - Task created trigger:
    - Filter: TaskOrder = 1 AND Status = Pending
    - Set Status = In Progress, send email
     
    Flow 2 - Task modified trigger (when Status changes to Complete or Rejected):
    - Trigger condition: Status eq 'Complete' or Status eq 'Rejected'
    - Get all tasks for the same ActionID where TaskOrder = current TaskOrder + 1... wait
    For the parallel scenario (multiple tasks with same order number), the challenge is knowing when ALL tasks at order level N are done before firing level N+1. You need a check, not just a trigger.
     
    Inside Flow 2, after a task completes:

    1. Get all tasks for the same ActionID with the same TaskOrder as the completed task
    2. Check if ALL of them have Status = Complete or Rejected using a condition: length(filter(tasks, status ne 'Complete' and status ne 'Rejected')) = 0
    3. Only if all are done, get tasks for the next TaskOrder and set them to In Progress + send emails
     
    The key expression to check if all parallel tasks are done:
    length(body('Get_parallel_tasks')?['value']) = 0
    where Get_parallel_tasks filters for same ActionID, same TaskOrder, Status not in (Complete, Rejected).
     
    This prevents double-firing because only the last task to complete in a parallel group will pass the "all done" check.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • David_MA Profile Picture
    14,689 Super User 2026 Season 1 on at
    As @Valantas notes, in the second workflow check if the get items returns 0 instead of 1 item to know you are done. With this change, you would put the apply to each on the no side of the condition and it will send a notification for all the items with the same notification order. If you wanted to send just one e-mail when there are multiple items with the same task order, you could use a Selection action followed by an HTML table action to create a table of the values with the information that needs to be sent and insert the table into the e-mail action.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 464

#2
Haque Profile Picture

Haque 431

#3
David_MA Profile Picture

David_MA 323 Super User 2026 Season 1

Last 30 days Overall leaderboard