Compare rows from different Excel

Today i’m trying to select the rows from different Data Tables, and when i put it in the if, show me this:

What can i do?

Regards!!!

In the If activity you need a Boolean value, or an expression that will evaluate to a Boolean value. Your expression, From r in DT3… Select r).FirstOrDefault will return a DataRow. Hence the error: DataRow cannot be converted to Boolean.
Are you trying to check if that expression is returning a row? Then use something like (From…FirstOrDefault) IsNot Nothing

2 Likes

It will give DataRow as output. You can’t use it in if condition.

You can check if the Select statement’s Count > 0

(From r In DT3.Select where r(0).ToString.Equals(row(0).ToString)Select r).Length>0

1 Like

Hi @Vivek_Arunagiri !!

I can’t put the .Length, jmmm
The thing is how can in do the validate? i feel so rookie

Regards!!

You can use

DT3.select(“[ColumnName]='” + row(0).tostring + “'”).Length>0

1 Like

Nope, it dosn’t Work, It throws this:

“If: The expression contains invalid date constant '#DR-T1130-P003

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