DataTable Lookup Null Error

Hi guys, I have an issue with DataTable lookup.
I am searching for a STRING value in my data table, if it is found there is no issue. After finding the string on column 2, I am getting as output the DOUBLE value from column 1.

But if it is not found I get the following error on my DataTable Lookup activity:

Lookup Data Table: DoubleConverter cannot convert from (null).

How can I handle this null value so the test will continue running?

Hi @Vlad_Bobes

Welcome to forum

Create a variable in the rowindex property of lookup datatable activitiy which store the rowindex let’s say index

Put an if Condition with condition as index<>-1

If the condition is true then

Output the value

Else

Do nothing

In this way u can avoid the error

Or

{row(“Number”).ToString,DT2.Rows(index)(1).ToString, DT2.Rows(index)(2).ToString}
other way put an if Condition with condition as output.ToString(" ") (where output is value obtained from lookup datatable activity)

Based on condition u can customize then and else section respectively.

Hope it helps you

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed::relaxed:

2 Likes

Thank you!
Solved.

1 Like

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