How to put condition for Null Variable Value


Hi
In above image you can see i put a condition if dc count is not equals to 2 it goes to the if equals it goes to else but some times DC comes with Empty Variable that time it throws error like

" if: Value cannot be null. (Parameter ‘Source’) "

How to handle this if value is null also

Thanks in advance

Hi @jai_kumar2

Since DC might be empty some time, you can use another if condition before DC.Count <> 2 to ensure the DC value:

If String.IsNullOrEmpty(DC)

Hope this helps,
Best Regards.

Hi @jai_kumar2

What about this condition in if activity

not string.IsNullOrEmpty(“DC”) And DC.Count<>2

try this

HI,

How about the following condition?

DC isnot Nothing AndAlso DC.Count<>2

OR

DC is Nothing OrElse DC.Count<>2

Regards,

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