String isnot Nothing working

I have issue with the condition “if (String variableName isnot Nothing)”. This condition is working properly for some times and does not support for sometimes. May I know why it is happening and how can I over come this?

@SanthoshKumar876
Please can you try Not String.IsNullOrEmpty(StringVariable). This will cater to both null and empty strings.

1 Like

Thanks for the Answer.

But I need to know, Why the conditions gets failed for sometimes and works for sometimes

hi @SanthoshKumar876

PFb Screenshot.

image


Mukesj

@SanthoshKumar876
If you have a String variable that stores “” as the value it means the String is Empty but not Nothing.

Please create a sample sequence Assign string var to “” and then use the if condition to test it.

Also try to see what happens if IsNullorEmpty is used ans see the difference.

3 Likes

if(Not String.IsNullOrEmpty(variableName))
This will solve your problem try this.

Cheers @SanthoshKumar876

1 Like

Thanks for the definition @SowmyaLeo.

But I face this issue, When I pass the string variable from one workflow to other. So here my condition gets failed for sometimes and works for sometimes as I don’t send empty string.

Thanks for the Answer @mukeshkala and @Jatin_Kamboj.

But I face this issue, When I pass the string variable from one workflow to other. So here my condition gets failed for sometimes and works for sometimes as I don’t send empty string.

@SanthoshKumar876

Please run the program in debug mode and see what happens when the value passes between workflows. If unable to solve, kindly post screenshots of the same.

@SowmyaLeo.

Unfortunately, This best thing happens only when I run the bot. When I debug, the value gets passed correctly.

will it be any memory allocation problem, as the build runs in Orchestrator.

@SanthoshKumar876 :
Please share a screenshot of the issue debug further.

Fine
if its unning in debug mode then it would for sure while been ran from normal mode
and also make sure that the argument directions are mentioned correctly for IN for incoming values and OUT for values used outside the current workflow

Cheers @SanthoshKumar876

1 Like