The current For Each activity is used to loop over a collection of items. This is definitely useful, but the standard for loop in VB.net uses a counter and a range and iterates over an integer value. See this documentation: For...Next Statement - Visual Basic | Microsoft Learn
I am requesting that a new activity be added that can take a counter variable, start and end numbers, as well as a step amount.
This would be very helpful for creating an idiomatic means of performing a given bit of code multiple times. The current workarounds are clunky, such as using a while loop with an assign activity to assign a variable being used as the index to itself with the step or attempting to create collections variables with the number of elements to represent the total amount of times that one wishes to iterate.
You can use a For Each activity with i as the loop variable and Enumerable.Range(1,20) to loop from i=1 through i = 20. This isn’t capable of stepping more than one but it does iterate over an integer value fairly easily.
I wasn’t aware of that, thank you. That mostly fixes the issue I was having. I was getting frustrated trying to create a collection that had initialized with a certain number of indexes and it wasn’t working.
I think what I initially suggested would still have value, not only for the skip but to have it be more idiomatically shown using the Workflow foundation setup. However, you’re right, for the most part, what you’re suggesting works.
I wouldn’t be able to say right which version introduced it (it was a while ago), but the Repeat Number of Times activity offers this exact functionality: