I have a table dt1, dt1 has many attribute columns and many rows, I want to know what judgment conditions can quickly determine any cell in the table has a null value. What is the most concise way to write a conditional judgment?

I have a table dt1, dt1 has many attribute columns and many rows, I want to know what judgment conditions can quickly determine any cell in the table has a null value. What is the most concise way to write a conditional judgment?

Hi

bool_exists = (From d in dtData.AsEnumerable
Let check = d.ItemArray.Any(Function (x) isNothing(x) OrElse String.IsNullOrEmpty(x.toString.trim))
Select check).Any(Function (e) e)

Use this in a assign activity and bool_exists is a boolean type variable

Cheers @491979546

Thank you so so much ,bro. I test this method just now , but it doesn’t work. can you show me a demo?

May I know what issue we are facing

@491979546

Actually , i use full join two dataTable, dt1 and dt2. there are 6 rows contain null or empty value. I determine the bool_exists, but it show me false.

first, I use the read range Activity , then i use IF Activity to check the the value of bool_exist. it return false , that means the result doesn’t close to what i expect …it should be if there is any row’s cell contain null value , then it return a true…

is that right?

That’s right

Try with this
bool_exists = (From d in dtData.AsEnumerable
Let check = d.ItemArray.Any(Function (x) String.IsNullOrEmpty(x.toString.trim))
Select check).Any(Function (e) e)

Cheers @491979546

Fine
Both the expression should work in this case
Make sure that the datatable name you have created is mentioned along the expression

And check with writeline activity like this

Dt.Rows.Count.ToString

If this gives more than 0 then it has some rows in it and the expression will work for sure

Cheers @491979546

Hi,bro。 is it if bool_exists is true means not existing a null cell ? or exist?

If it is true then it has null values
If it is false then it has NO null values in its cells

@491979546

:sob: it always return a True… i’m confused…

No worries

If the expression gives true as output then the datatable has null value in it

If it give false then datatable has value in all the cells and there is no null value in it

It’s as simple as that

Cheers @491979546

Actually,my data Table has many Rows,sheet1 contains null value Cell, sheet2 not exist a null value Cell. I test them , but it always return a True… :disappointed_relieved:

Would you please give me a Demo…Thank you … :pray:

Hi @491979546

I tried the Query given by @Palaniyappan, its executing correctly. Initially I too got boolean outcome as TRUE though no empty values in cells, To solve this mention the exact column range in Read Range activity(if Possible).

Make sure this is executing as expected and go for the expression

Mention the sheetname and range of the table correctly

@491979546

how to set the exact column range? the dt1 and dt2 I mentioned in the pic comes from ReadRange Activity

Thank you , bro . it should set the range of the table correctly. :joy:

Fine
Pls mark the comment with the relevant answer and expression as solution
So that it will be useful for many in future

@491979546

:joy:
Sorry, I misread it, it still doesn’t work. I want to cry. :disappointed_relieved: