I am not sure and will have to check, but my first guess was that the auto increment will only work if you do not assign a value to it but rather leave it up to UiPath. This is why dt.NewRow works - it creates an empty row in the Data Table and then the autoincrement works without an issue.
You could first create a row with Add Data Row activity like in my previous screenshot and then assign values to the columns with a few Assign activities.
Hi @loginerror. I gave first value as nothing but again 0 is getting added pls check if any need to correct anything. Please find the screenshots below
SNo column created and same created in the variable section and gave the first column value as nothing.
Hi @loginerror. Thank you. I worked separately by including add data row in a loop and it produces a result as you given. However, my bot completes one transaction by using an hot key like ctrl+o and saves exception log in excel file (there is no loop to add data row) and again another user initiates a bot using same hot key and the bot runs. so everytime the bot runs it is considered like frehs transaction only 0 saves in SNo in exception log file. Is there any workaround for this?.
Hi @loginerror. I have attached xaml could you please correct it how to load excel file into data table variable. I am using generate data table but not getting expected one. Main.xaml (1.2 KB)
There was something I missed in my original answer - the Read Range activity does not automatically assume that the first column should increment in value, thus we cannot simply add our new row to the Data Table it automatically creates.
The solution is to Build our Data Table also for the situation where the file exists and then fill it in with data read from Excel.
I hope the xaml file is clear I cleaned it up a bit and commented a bit too.
Hi @loginerror. Thank you very much and i am going to implement this in my project by removing append range. I am new to uipath and forum helps me a lot.