Hello everyone! Hoping someone can help me with this.
I have a Switch activity which looks at a Column in a datatable. Inside each item on the Switch, there is a For Each Row.
All of the activities in the For Each Row work perfectly (meaning, the automation only looks at the rows for the specific item), with the exception of Write Cell.
When the automation reaches the second item on the Switch and it gets to the “Write Cell” activity, it starts overwriting the first rows in the datatable (which belong to the first item on the Switch).
This is what I currently have for the "Write Cell" activity:
If I remember correctly, this process creates a temporary datatable for each of 3 scenarios. Because of this, the row is getting reset back to zero once the for each loop finishes. What you need is a running index.
Instead of using the datatable row as the index, I suggest to increment the index variable manually.
So put an assign activity at the very beginning of the workflow, assigning index = 2. Then, after each write cell activity, use an assign activity to assign index = index + 1
Can you share your workflow? I believe you’re misunderstanding my suggestion. It should not reset to 2 each time if you have your assign index = 2 activity at the very beginning of the entire process. The scope of the index variable would have to be the broadest level