Counter Activity in While Loop

Hello,

My process demands that the bot perform an activity, in a system, and then move to another area still in the same system. Currently, I have the bot reading the options to select inside the system, saving that as a variable, sending a hot key to go down the list, and then entering that list item. Once entering the list item, the bot performs the task configured for, and then must access this list once more and select the next option down. Before selecting, I have the bot reading the list item and saving it as a variable. This is all in a while loop that states once these companies match, to leave the loop (exit the system).

My question is on the counter. I must have a counter to make this work. I know I may do this through an Assign activity. But how to I advance the counter to count past 1 and send more hotkey arrows down?

Thanks in advance

Hi @Sara_Car,

you’ll need to use another assign activity to increase the counter (inside the loop but either at the very beginning or after all the tasks in the iteration)
image
and to execute the hotkey n times you’ll need to place it in a for loop:
for _ in Enumerable.Range(0,n-1).ToArray()

BUT have you tried yo resolve that with selectors ? Don’t know the exact scenario but you could create a selector with counter variable to select n-th element on the list

Hope that helps!
Best Regards,
Filip