Write Data in a column with random number of rows


#1

How to write data in a column if the amount of rows inserted is random?


#2

Read the excel into data table using Read Range Activity. So the data will be in datatable.
So to get the number of rows in your excel,
numRows = DataTable.Rows.Count


#3

What does that do? I didnt get it though.


#4

Loop thru each row of Data Table.

If you know the IDs (fixed) instead of IF, you can use the switch activity.

e.g., SWITCH ID

Case “1234”:
Case “3344”

Assign Activity, intIndex = 1
For Each row in DT
         intIndex = intIndex + 1
         Id = row(1).ToString
         if id == “1234”
                  use Write Cell Activity, Range -> “A” + intIndex, Value = “TA”


#5

Do u mind doing it in UIPath and screenshot?