Write cell in order for each row

Hi all, hope you guys had an excellent start in this new year, i am having a bit of a problem, so im using a for each row and i have a counter set, inside the for each i have several if statements that check a locations name and writes a value to excell, this is working, how ever its not writeng all the values in consecutive rows for example: A1, A2, A3 and so on, instead its writing the values A1, A2, A5, A8, A9 and so on every time the if statement returns true, how can i make it write the values in order like: A1, A2, A3, A4, A5 and so on?

HI @Sidney_Vogel

Can you show a screenshot of the workflow that you have done so that we can get an idea how you have implemented this logic…

Hi @Lahiru.Fernando Sure: UIpath Workflow.zip (30.4 KB) make sure you select the Mailer Tool Test file.