How do I break out of a Flow Control Iterator’s iterations?
Context: provisioning new members with email handles in our Google workspace domain. We use various combinations of the letters in a first and last name along with middle name initial if we have it. Prior to the scenario, I generate a bunch of possible combinations - enough to guarantee that we’ll be able to make unique handles for our member population as it grows (& any member may have their account in our domain for up to a decade.)
So, the scenario receives this array of possible values, splits them into bundles, and evaluates each bundle’s value to see if it is already in use. When the search module finds one not already in use (or suspended), a new account is created with that handle as the primary email address. at this point in the scenario, I’d like the iterator to stop iterating over any remaining bundles.
Once a match is found and I make a new user, I no longer need to continue with the iterating. If possible, I would just as soon not use the tasks it will take to process the remaining bundles.
FWIW, I have filters set up between modules and use a data store to handle identifying the state change from “Handle not in use && New Handle not yet created” to “Handle not in use && Handle already created.” This way, if the first item gets used for the new handle, I won’t create user accounts for the following iterations, but for each one, I will use a task for the filter check.
Is it possible to make the iteration (and effectively the scenario) stop after the new user account is created?
As best I can tell, however many items you feed the iterator, it will process all of the bundles.
As a more concrete example, let’s say I have an array of [a, b, c, d, e] which I turn into bundles.
I iterate over the bundles one item at a time with the downstream branch from the iterator module.
Let’s say the first letter ‘a’ qualifies as a valid value from a GWorkspace User search module, then the next module is a Create user. Once that is done for the first qualifying value of ‘a’, the scenario does not need to continue iterating over the remaining values in the array.
Is there a way to not eat up the resulting tasks of checking the remaining array values: b, c, d, & e?
It doesn’t appear that there is.
I tried using the “Break” module, but that only works on an error handler branch, not as a way of breaking out of an Flow Control Iterator.