I have an array of strings which will contain ‘reference numbers’ e.g “4343”,“5454”,“6566”. I’ve got a flow going where it will get the length of this array (3 in this example) and a counter going. In a flow decision if the Counter < Array Length it will loop back around and the plan is to work the next reference number.
The problem I have is, the component that does the work, I want to pass a reference number in each time. I have an in argument called ‘in_strReference’. What code do I write in that argument so it picks up the next reference number from the array? So it’ll work ref number ‘4343’ then ‘5454’ etc
However, when “Counter” equals “Array.Length-1” (when current ref is “6566” in your sample), it will throw IndexOutOfRangeException, because there is no next ref. Is there any rule for it?
I’ve started the counter at -1 to make sure it works the first item in the array and in the flow decision is Counter < RefNumbers.Length
Please can I ask how I can stop the error from occurring? The end result is that when it’s worked the last reference number (which can vary from queue item to queue item) it goes to false
How about to change FlowDecision condition from “Counter < Array Length” to “Counter < Array Length-1”? Probably it prevents exception but I’m not sure if it is right from the view point of business logic.