If you are using a For Each Row, then would be like this in Assign activity: row("DATE") = variableDate
And after all is done you use Write Range to write all back to excel file.
i used invoice as input, inside For Each Row activity then i read invoice date and stored in variable. now i need to write that value next to the Invoice (Date row).
is it possible to write invoice date after each value ?
@Srinu6038
If I am not wrong, You are reading the invoice numbers from excel, searching for the invoice in portal and extracting the date. Now you have to write that date in the same excel where you read the invoice numbers.
Use read range activity to read the Invoice numbers from excel. Output of this will be a datatable, dtTable
Use for each row activity and loop through each rows(row) in the datatable.
Search the invoice number in the portal and extract date
Get row index, dtTable.Rows.Index(row). The result will be an integer representing the row index, intRowIndex
Use write cell and specify cell value as [ColumnIndex][RowIndex] like “B” + (intRowIndex + 2).tostring
Note: + 2 => excludes Header and the row index always starts from 0 but excel cells start from 1
Alternatively, you can add a column into your datatable and update the value in that. But with huge data, if there any exception occurs in between, all the previously searched data will vanish and there by forcing you to redo the entire process for all records.
Using write cell, the data will be updated real time. If there any exception, next time you can get the only records for which there is no date written and then do the search only on them.
read range activity to read invoice numbers from excel, output as dtTable and also created another datatable for final output.
used for each loop activity, searched invoice numbers in portal and store invoice date in string variable.
used add data row activity inside loop to store each row in datatable.{ invoice number, output date}
used write range activity outside the loop to add datatable in output excel.
As you mentioned, if there is any exceptions occurs, i need to restart entire process for all invoice numbers. today i will try this method and let you know.