Flow Designer For Each only iterates on 1 record. KB0824613?

fbs
Giga Expert

I have a flow that does a Lookup Records and then does a For Each on those records; for each record I write to the log.  There should be 5 records.  When I do a test run (shown in the attachment), it does say 1 of 5, but it is only iterating through one record.  Is this a bug?  I did see KB0824613, which says: Flow Designer "for each item in" action does not return all the records.  It says to change the "Run As" flow property from "User who initiates session" to "System User".  I did that, but it made no difference.  What am I missing here?  I am running Tokyo.

Thanks

1 ACCEPTED SOLUTION

It turns out that looking at the log file shows that the 5 records were logged correctly.  Somehow, the test run doesn't show each iteration, but the log file does.  I don't know if that's a bug in the test execution flow, or if it's just that I didn't know what to expect.  But in any case, this works fine.  Thanks

View solution in original post

8 REPLIES 8

Isaias H
Tera Guru

Hi fbs,

 

From the image, it appears that you have 5 records. Can you hover your mouse over the "1 of 5" section to see if an arrow appears for navigating through the records? Additionally, have you checked the system logs to confirm that only one log is present?

 

I hope my response has been helpful. If so, please consider marking it as such. Thank you!

Amit Gujarathi
Giga Sage
Giga Sage

Hi @fbs ,
I trust you are doing great.

Firstly, regarding the KB article you mentioned (KB0824613), it suggests changing the "Run As" flow property from "User who initiates session" to "System User" to resolve a similar issue. However, you mentioned that you have already made this change and it didn't make any difference. It's good that you tried this step, but since it didn't work, we'll need to explore other possibilities.

Here are a few things you can check to further investigate the issue:

  1. Verify the Lookup Records operation: Double-check the configuration of the Lookup Records operation within your flow. Ensure that it is set up correctly to retrieve all five records. Make sure the conditions and filters are accurately defined.

  2. Inspect the input/output mappings: Confirm that the input and output mappings of the Lookup Records operation are properly configured. Ensure that the input values are correctly passed to the operation and that the output values are captured appropriately.

  3. Review the For Each loop configuration: Check the For Each loop configuration within your flow. Ensure that it is correctly set up to iterate through the records returned by the Lookup Records operation. Verify that the loop's "Collection" property is receiving all the records.

  4. Debugging the flow: Consider adding some debugging statements or logging within your flow to track the flow's behavior. This can help you identify where the issue might be occurring. For example, you can use the "gs.log()" function in a Script action to log specific information during the flow execution.


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



It turns out that looking at the log file shows that the 5 records were logged correctly.  Somehow, the test run doesn't show each iteration, but the log file does.  I don't know if that's a bug in the test execution flow, or if it's just that I didn't know what to expect.  But in any case, this works fine.  Thanks

Shanmukhi07
Tera Contributor

I am having similar case where for each loop shows (1 to 87) and when I expand for each in flow execution page I can see all 87 records but it is running the loop only once and even in logs I see only one log, I have changed properties to run as system as per KB, still same. Any idea what could be the issue

 

Shanmukhi07_0-1721026229921.png