function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BarracksBarracks 

Simple Loop in Cloud Flow Designer

Hi Guys,

Below is a simple loop that I'm trying to create in the Cloud Flow Designer:

For( each element in the collection)
{
  if(condition=true)
    { do something}
}

So I built this loop that gets a collection of 10 records and iterates on each one of them.
On each iteration,  there is a Decision element that checks a condition, if it's met - it goes to an Assignment object. if not , it suppose to move on to the next element on the collection.
User-added image

The problem that it's not working, the loop only runs one time.


My workaround was to add another Assignment element as seen in the screenshot below:
User-added image

How can I remove that second assignment element? Why is it even necessary? 

Thank you,