Error message in Excel application scope

I am trying to develop code where Bot will read data in Excel application and insert data in other applications. Here I encountered with two issues.

  1. Getting error message in Excel application scope " one or more children have validation errors or warnings.

  2. My excel sheet has blank values, my Bot should skip the Null or blank values and should move further to complete the Loop. Please suggest how to achieve this.

Thanks in Advance
Ravi

Without seeing the error message:

  1. You have a syntax issue within the activities. You can hover over the blue icon next to a field to see the error and correct it accordingly.
  2. This can be achieved by an IF statement inside a For Each Row activity, like that:

I hope it is helpful :slight_smile:

1 Like

Will try it out. Thanks!

row.Item(“ColumnName”).ToString - will throw null reference exception if cell is empty.
Better approach here use
string.IsNullOrEmpty(Convert.ToString(row(“ColumnName”)) - because it’s working for null values.
or something with guard clause like this
( row(“ColumnName”) Is Not Nothing AndAlso row(“ColumnName”).ToString <> condition)

1 Like

Nice suggestion @uemoe, increases robustness of the solution.

Just a quick question - is it possible to get a null value when using Excel read activities? When would it happen?

I’ve got a few times when read empty excel cell. After these cases I stopped using simple “.ToString” and switch to Convert.ToString()

Okay, good advice. I think it might come from the read activities automatically detecting the type of the column for the data table. Maybe when it sets a table as Boolean and encounters an empty cell instead of True or False it gets a Null.

Actually I was wrong. I’m not able to use convert.ToString() for GenericValue variable only option it guard clause check. See example
example.xlsx just empty excel file with Sheet1.

Thanks every one.

  1. I am able to clear error message
  2. I am trying with syntax - Colomn name variable.ToString.Length=0 in if condition.
    But it seems bot not going to second line in Excel sheet. Please advise.
    image

Regards,
Kiran

your looping condition is going wrong then. can you share your xaml? or screenshot of the loop?

Hi Abdul Azeez,

Code

data sheet

Bot able to read one line and not going further.
My requirement is whenever there is Blank or Null , it should move to next cell, read and write in Applications.

Thanks in Advance
Kiran

Hi @ravipo

See attached xaml. I simplified it to show you that the basic principle works.
As you will see, it will properly process the rows.

Stock Locators5.xaml (14.2 KB)

Hi ,

My requirement is Bot should read the data in Excel sheet and if it is blank it should go to next field and write in Oracle applications.

Please advise

Regards,
Kiran