I’m having an issue trying to add data to the 1st row of the 2nd column in my data table, in that when i try to add data to the 1st row of the 2nd column in the datatable, the data isnt added to the first row, it continues where the data from column 1 ended but continues in the 2nd column, ie when the table is exported to a CSV file it looks like this:
For my Activities, i start off with the Excel application scope which views 2 columns in an excel spreadsheet and stores the values for those columns in a system.collections.generic.IEnumerable<system.object.
I then create a data table and successfully populate the 1st column with the values i got from from column 1 on the Excel spreadsheet, i used a For loop for this which worked fine, ie
@sam.greenwood
problem is that you are using “add row activity”. It is checking whole row when row is empty then its adding values in column. In simple words you have already utilized all the rows that’s why its adding from end of first column.
To solve this problem and to update column2 please use Update datarow activity.
I want it to start off at the first row of the 2nd column then when there is a value to add just keep adding it to the next row downin the 2nd column…any idea what i should put in the Row field?
@sam.greenwood
use for each for datatable and give DT,
inside for each use “Update row item”
in update row item ->value section give value
in row give ->Current Row
Data is now being written from the first row in both column 1 & Column 2, great
The next issue i’m having (hopefully the last) is that the values being written from the array into the CSV are being written as ‘System.Collections.Generic.IEnumerable`1[System.Object]’
Ive tried {column2.ToString()), column2.ToString() but nothing seems to work
When populating the first column, i get the correct values displayed, the only difference is when i populate the first column i just used a For each and not a For each row in the database activity