How to autoincrement the serial number in the excel

How to autoincrement the serial number in the excel the serial number has to start from one. In builddatatable activity I created field slno with data type int32.checked the autoincrement checkbox.then in the adddatarow activity add arrayrow as “nothing”. Anyone please help to solve this issue.

find starter help here:
AddRowIndexToExistingDataTable.xaml (7.8 KB)

Hey @Chippy_Kolot

Try adding {} empty array instead of Nothing

Thanks
#nK

I tried but getting error “Array initializer has too few dimensions.value of type 2d array of string cannot be converted to id array of object”.

Hey @Chippy_Kolot

I request you to please share a snap of what you are trying to do.

Thanks
#nK

excel
Here serial no is taking from zero.but it has to start from one…

@Nithinkrishna If you create a column in data table with type Int32 it will take starting value as 0. Why don’t you try passing the counter variable which has Slno in add data row activity ( along with employee name)

Hey @Chippy_Kolot

You can set it but not through activity as it doesn’t have the prop.

Kindly ref this to write in code - DataColumn.AutoIncrement Property (System.Data) | Microsoft Learn

Hope this helps.

Thanks
#nK

Ya I got.Thank you.
1.In datatable I created a column named serialno with datatype Int32.
2.After add datarow activity I created a variable in assign activity.(Serialno=Serialno+1).
3.Passed this variable to the add data row activity.

@Chippy_Kolot

Kindly close this topic if any of the above solutions helps you. This way it helps others who are facing similar issue