Hi there - could someone help with this auto-increment datatable issue I’m having please? It seems to be alluded to in other threads but I can’t find any conclusive solutions.
I have a datatable to which I’m adding rows for each iteration of a loop with an index/serial number column which I want to increment by 1 for each new row, beginning with ‘1’ for the first row. I’ve configured the Add Column activity to ‘Auto-increment’, but the first row in new datatable is being numbered ‘0’.
This is how the index Add Data Column is configured:
Instead of using Auto increment feature, you can achieve this same by doing little programming.
Use a counter variable and initialise with 1 by default. Inside for each loop, in add data row activity, put counter as first value in place of Nothing. Just before the end of for each loop, increment counter by +1. This way you’ll able to get your id starting from 1.
@singhonkar, that has worked! Thank you so much - that’s really helped me move on with this automation - thanks for taking the time to suggest this - much appreciated!