If condition check equal checkName=Webcheckname and Webcheckname not null

checkName and Webcheckname are two variables
if condition check equal checkName=Webcheckname and Webcheckname not null

Hello Aditya, can you please elaborate your question?

Hi @Aditya10989,
I hope this helps,
checkName.equals(WebcheckName) and Webcheckname is nothing

Thanks,
Abhishek.

yes sure as mentioned in attachment I am checking in if condition equal to or not.In this case if I got null value then it not move to else case it throw the

error

In this case you can add an additional check before your if to check if the variable is null and then either throw and error/exception or do accordingly. if not null it will come inside this if and evaluate.

1 Like

Thanks for reply this will work …?
In this condition I am checking equal to and WebcheckName2 is not null.This is my condition
(checkName.equals(WebcheckName2) and WebcheckName2 is nothing) and (CheckStatus.Equals(WebCheckStatus2) and WebCheckStatus2 is Nothing) and CheckConditionRun=False

Hi @Aditya10989,
I didn’t get your question previously, try @nadim.warsi answer and do let us know if that solved your issue.
Cheers! :slight_smile:

I try the above condition this is not work for me.As mentioned in attachment.not null condition not work
this is condition
here checkName,WebcheckName2,CheckStatus,WebCheckStatus2,CheckConditionRun are five variable
lets suppose value of checkName=‘a’,WebcheckName2=‘a’,CheckStatus=‘y’,WebCheckStatus2=‘y’ and CheckConditionRun =false
all condition matched this goes to in side if condtion but it goes to else case.

(checkName.equals(WebcheckName2) and WebcheckName2 is nothing) and (CheckStatus.Equals(WebCheckStatus2) and WebCheckStatus2 is Nothing) and CheckConditionRun=False


@nadim.warsi

for above condition, you should try

checkName.equals(WebcheckName2) and CheckStatus.equals(WebCheckStatus2) and CheckConditionRun = False

This will check if all the conditions are true, then it will go in If part. If any of the condition is false, it will go in Else Part.

If this isn’t your solution, try to find the which condition gives false due to which it goes in Else Part
Try mentioning one condition at a time.

Maybe this is why it goes in Else Part, since the WebCheckName2 = ‘a’ and not Null

Thanks! :slight_smile:

1 Like

you need to use ‘is not nothing’ because according to your expression you are looking for WebCheckName2 is nothing.
So there is a confusion here because you were checking ‘Webcheckname not null’ and you changed it to ‘Webcheckname is nothing’ which is opposite.

Try:

(checkName.equals(WebcheckName2) and Not(String.IsNullorEmpty(WebcheckName2)) and (CheckStatus.Equals(WebCheckStatus2) and Not(String.IsNullorEmpty(WebCheckStatus2))) and CheckConditionRun=False

2 Likes

yes this is I already try this condition work for me
checkName.equals(WebcheckName2) and CheckStatus.equals(WebCheckStatus2) and CheckConditionRun = False
but when I got null value in WebcheckName2 then this not move to else and it throw the error.
So in same condition I want to apply not null condition also

Thanks I think this will work for me give me few mintues I will update you this will work for all condition or not.Thanks

2 Likes

As mention in attachment if condition not match then move to else condition.Now if I got null value and value not matched it throw the error how to handle this

1 Like

Hi @Aditya10989

You can Try

variable.IsNullOrEmpty (variable)

You can set your variable to String.Empty @Aditya10989

cheers :smiley:

Happy learning :smiley:

2 Likes