Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Flow Ignorning Condition AND Not Updating per Correct Record

(0) ShareShare
ReportReport
Posted on by 264
Hello, I have a flow I've been working on for a few days now and have slowly gotten it to work for the most part.  However, it's not producing the desired results.
 
I have two lists (PTO Requests and PTO Tracker).  The concept is that requests are put in via a form and placed in the PTO Request List, and when the PTO has actually been confirmed as completed, the Supervisor marks it as Completed, and the PTO Tracker list adds the hours used for the specific request to their Employee Records PTO used Column.  Below is the PTO Request List.  This flow I'm working on should trigger when a record is modified.
 
 
Well, I'm at the point where when the Request Status is marked as Completed, the flow is triggering, but it appears to be ignorning the Condtion that the Request Status equal Completed, and it's taking the PTO Requested Hours from the first record in the PTO Requested lists and updating all Employee Record PTO Used Column in the PTO Tracker list to the first record's PTO Requested Hours.
 
 
In the screencap above, the Request Status was marked as Completed.  The flow will trigger as it should, but this is where it doesn't do what I need it to.  Below is the entire flow.
 
 
Below is the screencap from the results of the Flow in the PTO Tracker list.  It's adding 40 hours to each employee's PTO Used Column.  Based on what was updated on the PTO Request list, it should first, ignore the first request because it's marked as Requested and NOT Completed.  Secondly, once it gets past that, it should be adding the PTO Requested Hours of 8 to the affected Employee's Record in the PTO Tracker List.  In other words record 1 should still be 0 (zero) and record 2 shoud be 8.
 
 
Can someone please tell me where my logic is broken in this flow and set me straight?  I know I'm not doing something right.  Also, a couple other notes... the expressions on the Set PTO Used and Update PTO Used On PTO Tracker PTO Used Column were finally completed after discovering the flow was not cooperating with quick expressions available from previous steps. 
  • Mark Nanneman Profile Picture
    Mark Nanneman 976 on at
    Flow Ignorning Condition AND Not Updating per Correct Record
    I get it, believe me. 

    [Edit/Update:  Originally I mentioned  here something about redundant loops getting created in the new flow designer and someone immediately reached out to me about the issue.  While explaining how it happens and demonstrating it they fixed it.  Either that or it was a temporary thing for me.  In either case, thanks Microsoft!]

    Good luck, and if you get your flow working please mark my response as an answer, thanks!
  • forbudt4u Profile Picture
    forbudt4u 264 on at
    Flow Ignorning Condition AND Not Updating per Correct Record
    Grandma always said two heads are better than one, Mark Nanneman.  Your prognosis was spot on and makes total sense once the light went off. The reason I had it set up the way it was because during my original attempt to set this up I kept having issues with the flow reading the hours as a float value, and it was not seeing the Request Status' correctly.  The 2nd For Each in the last loop was my attempt in repairing those errors, and in my attempts to try to correct that, I didn't put two and two together about removing the initial Get Requests and the 2nd For Each. 
     
    Brain fog kills... thanks for pulling me out of the darkness.    
  • Suggested answer
    Mark Nanneman Profile Picture
    Mark Nanneman 976 on at
    Flow Ignorning Condition AND Not Updating per Correct Record
    I might be missing something, but I think your flow is setup to update all PTO Trackers on all PTO Requests whenever one is Completed.  I think it might even be going through all of your PTO Trackers for all PTO Requests twice.

    Is there a reason why are you listing PTO Requests after the PTO Request modified trigger?

    It also looks like you have nested loops that are looping through the same list of items.  If so, you definitely don't want to be doing this.


    It looks to me like you have it set up to where when one PTO Request is modified you loop through every single PTO Request then loop through every PTO Tracker for each of them, then update them all if the trigger PTO Request is complete, and then you do it again.

    If I'm following your desired goal I think you only need one loop (the "For each Employee loop").  So you need to remove the "Get Request" list action, move your condition out of the first "For each record check request" loop and delete that loop, then remove the second "For Each" loop in the true branch, and fix any references to these unnecessary loops.

    Let me know if that helps

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard