Cycling Through DataTable & Excel file and Filling in Blank Rows in Data Table with Data from Excel File

I have two data sets (lets call them SOURCE & DESTINATION). The SOURCE Excel file has 1 column with 20 cells/rows and the DESTINATION data table has >100 row and multiple rows/columns. I am trying to run a for each loop through DESTINATION file and where ever there is a blank cell in COLUMN XX, input the value from SOURCE file, then move down to the next row in the SOURCE table COLUMN A until it reaches the last row, then circle back to the first row and loop through that until all rows in DESTINATION COLUMN XX have been reviewed.

See attached image for basic view of what I am trying to do. Copy & Paste SOURCE COLUMN A values into DESTINATION COLUMN XX

id2 would get yyy
id4 would get zzz
id5 would get yyy
next blank COLUMN XX would get zzz
and repeat until DESTINATION has gone through all rows

image

Any suggestions on how to proceed?

Hello @Austin_Jones1 ,

Welcome to UiPath Community.

It can be done as below.

  1. Create two int32 variable and assign them 0(V1) and rowcount(V2) of source DT.

  2. Loop through destination DT and for every null value, assign value from source DT using V1(S_DT.Rows(V1).(“Column_Name”).

  3. Increment V1 by 1 and verify if it less than V2. If yes, continue else reset V1 to 0.

I hope, it help.

Read both into separate datatables. For Each Row through the destination table and whenever you encounter a blank value, update the value with a lookup from the source datatable.

Once done, write the entire destination datatable to a new Excel file.