IsNothing activity always giving negative output

Hi, i am using the IsNothing activity to create a condition to check if my string variable is empty or not but the if condition always enters the if-else and not if-then, no matter my variable is empty or not. For reference in the attached pic the loop always output - Decision_ + “is not empty”.

@shekhawat.arjun1307 - When its empty and going to through the else loop, what is your message box output?

Yes it is displaying - is not empty

Hi @shekhawat.arjun1307

Could you please try the below statement and update whether its working or not !!


Thanks !!

1 Like

@Rakesh_Sampath It works, Thanks.

1 Like

Hi @shekhawat.arjun1307,

Although this thread has a solution, for people who are wondering why this did not work, here is a short explanation.

  1. When you use IsNothing(VariableString) this will always return False. This happens because IsNothing method will only work if your VariableString is a Reference Type variable i.e., you explicitly have assigned Nothing to it. See Remarks section in this link.

  2. When you have a Value Type VariableString, either the IsNullOrEmpty(VariableString) or String.IsNullOrWhiteSpace(VariableName) will work fine. A Value Type can also be for example an empty string ("").

For anyone wanting to know more about Value Type vs. Reference Type

Workflow for reference: IsNothingVs.IsNullOrEmpty.xaml (7.8 KB)

Hope this clears some doubts.


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