To enter data to web application if row not blank

Hi All,

I have a robot that reads a range of data in an excel (e.g. B19:O35) and I am unable to edit these excel file. For each row. the robot proceeds to enter the data into a web application until an empty row and it breaks.
Sometimes rows are left blank in between the data, which means the web application is not filled correctly.
How would I modify my robot to cycle through each row and only enter the data into the web application for the rows with data and skip the rows with no data then perform a break after last row?

@chend - you can use if else activity to check your empty row and enter data accordingly.

@chend
Try using string checking inside for loop
String.IsNullorEmpty(strvalue)

Hi @chend,

Please use below line of code to remove empty rows from datatable for the bot to process all rows without break.

DataTableName=DataTableName.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(“”))).CopyToDataTable()

Please refer below thread to know more.

Regards,
Rahamtullah

Hi rahamtullah,

I presume this should be executed within the “Do” activity just after the “Read Range” activity and would no longer require the “If” activity as it should break at the end of the data table?

Hi @chend,

Exactly. You need use assign activity to remove empty rows before you make bot to start entering data into web application.

  1. Read Excel data into datatable.
  2. Remove empty rows.
  3. Loop datatable to enter data into web application

Regards,
Rahamtullah

1 Like

Hi rahamtullah,

Thank you for the confirmation and suggestion. I will try to implement this method.