ForEach cause Infinite Loop
Application Type
Traditional Web
Service Studio Version
11.10.8 (Build 37885)

Hi All

Sorry, I can't share my real module and the attached action flow does not reproduce my issue.

But they have the same flow.

Even the SourceList only has one element it never ends the loop. My thought is that ListAppendAll copies the list, But it somehow points to the same list, and the ListFilter cause CurrentRowNumber reset.

Any suggestion is welcome. 

Kind Regards,

Champion

Addition information.
1, I tried to replace ListAppendAll with ListDuplicate, But no luck.

2, If I delete the if node ("SourceList.Current.Name = ListFilter.FilteredList.Current.Name" ), then the loop is only run one time. Sorry, the node information of my first image is wrong. It uses a filtered list value.

Could u explain what are you filtering out with ListFilter?

I have tried to duplicate the scenario, but it always ends. I have two questions:

  1. The first one is the same as Ragavi: what are you filtering and in what list  are you doing this?
  2. What is the relation between SourceList and GetClasses3? Are they related to the same Entity?
Champion

Hi 

Thanks for every reply. The Image attached is not my real module that got the problem, but the logic is similar.

My problem is even first ForEach's source only has one element, and when it cycles back to the ForEach node the CurrentRowNumber is 0. 

Kind Regards,

Due to the way the flow in the cycle arm is implemented, it ends the first time the list filter has no results or the name is different.

I think that what you really want is to add one more entry to the output variable, always in not empty and the name exists.

Hi Tom,

Good evening!

What is the filter condition of your aggregate? I think the issue is on the 2nd loop. Amd as Ragavi mentioned, what is the condition of your Listfilter.

Kind regards,

Chris

Champion

Hi 

Thanks for every reply. 

My problem is even first ForEach's source only has one element, and when it cycles back to the ForEach node the CurrentRowNumber is 0. 

I finally changed ForEach to If loop and judged by local available that indicate the current index, the problem is solved. I just curious why this happens.

Kind Regards,

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.