Identify empty cells in DataTable

Hello,

I have an Excel spreadsheet with two columns.

  1. The individual cells of the columns are not always filled. The content is always numeric (double).

I write these values into a DataTable.

The two columns are to be transferred to a second DataTable subject to two conditions.
Condition 1: Column 1 is not empty and column 2 is empty.

I tried the following:
In a For Each Row activity an If statement with the condition:
Record(0) >= 0 and Record(1) = IsEmpty
Then Message Box (“Bla”)
Else Message Box (“Blub”)

Unfortunately, the condition does not work. Is there a solution?

Translated with DeepL Translate: The world's most accurate translator

@Kytyzow,

try with this condition and check once,

Record(0) >= 0 AndAlso Record(1).Equals(DBNull)

Hi , inside for each row use
2 Get row item activities for 2 columns with outputs as string variables ex:Var1 for column1 , Var2 for column 2
Now use if condition

And write condition as
If
Not String.isnullorempty(var1) and string.isnullorempty(var2)
Then
Message box(“Bla”)
Else
Message box (“Blub”)

I’m getting an error message.

18.4.4+Branch.support/v2018.4.Sha.f763d4ae80fa90017d15cf7fd8625d0b338b8116

The workflow has validation errors. Review and resolve them first.

Compiler error(s) encountered processing expression “Datensatz(8) >= 0 AndAlso Datensatz(10).Equals(DBNull)”.
“Option Strict On” does not allow operands of type “Object” for the >= operator.
“DBNull” is a type and cannot be used as an expression.

@Kytyzow,

Check with this,

Datensatz(8) >= 0 AndAlso String.IsNullOrEmpty(Convert.ToString( Datensatz(10)))

This works for me:

dt(8).ToString <> Nothing and dt(10).ToString = Nothing

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.