Flow Designer 'For each' loop issue.

Rocky5
Kilo Sage

Hello Experts,

 

I am new to Flow Designer, I want to send an email daily at particular time to 'Approver' and 'Requested For'. so, I have created a flow with trigger to run Daily at particular time. Flow looks up for approval records that are in 'Requested' state, task type is Requested Item and created on today. And then, I had 'For each' loop and check if each record is approved or not. And, I have another look up on Request Item table (screenshot below) because email should be sent to 'Requested For' as well. 

Rocky5_2-1669402365039.png

Now, The issue is, I have submitted 3 catalog items so, 3 approval records are created. In my first 'For each' It shows 1 of 3 and in second 'For each' it takes only 1 record and after flow is complete I see the email is sent to only 1 record's approver and requested for but not for other two records.

 

Rocky5_0-1669402131167.png

 

what could be the issue? And how can I resolve it. Please help!

 

Thanks,

Rocky.

 

4 REPLIES 4

JP - Kyndryl
Kilo Sage

Hi Rocky,

May be easier to do the Flow on the Approvals table (sysapproval_approver) where State = Requested and Source table = Requested Item.

You can then iterate for each item and send notifications to Approver and Approving.Requested for

 

Regards,
JP

Hi JP,

 

Sorry I didn't get you exactly. I wanted to run this flow daily at scheduled time (like scheduled job), And, I see I cannot dotwalk for 'Approving.Requested for' in the flow.

 

Thanks,

Rocky.

JP - Kyndryl
Kilo Sage

Hi Rocky,

Please try this:

JPKyndryl_2-1669428820501.png

1) Retrieve the sysapproval_approver records that are in State = Requested and Approval for.Task type = Requested Item.

2) For Each Approval record

3) Send notification to the Approver

4) Retrieve the RITM reference in the approval record

5) Send notification to the RITM's Requested for

 

 

3) 

JPKyndryl_3-1669429033947.png

4)

 

JPKyndryl_5-1669429121869.png

5)

JPKyndryl_7-1669429251428.png

 

 

 

 

 

Regards,
JP

Hello JP,

 

Did you test the flow you suggested. I am doing almost the same flow right? what's the difference?

Rocky5_0-1669846677617.png

 

Thanks,

Rocky.