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
Melissa GMelissa G 

Visual Workflow - Stopping a Loop Once Criteria is Met

Good morning! I am stuck and hoping someone can assist me. I am very new to visual workflow and just trying to muddle my way through my project. 

We have a department that needs to have their cases 'quality checked'. There are 11 users setup in a round-robin type rotation. The rotation is a custom object so I added a field to house the number of cases each user should have QC'd. Normally users should have either all of their cases QC'd or a subset of cases QC'd everyday. I have been able to successfully find the users,find the cases, find the level of QC, and create (new) 'QC cases' that are assigned to another team. I have only been able to do this for users that need 100% QC, however. Once I get to the part where I need to find the level of QC (less than all) and then output that number of cases, I am stuck. This will be an auto-launched flow so I have placed an email where I believe the other logic should go. However, being so new to visual workflow, I am not sure if I am even on the right track. Right now, everything is in a loop, which contains a loop and a decision. I have a two part question, therefore.

Does this flow have the correct structure?

How do I limit the output of cases to only the level of QC? (QC works as 1 new QC case = 1 case to be QC'd)

My flow is below. Thanks so much in advance!

User-added image