Getting Error: Input String was not in a Correct Form

I’m getting the error “VisualBasicValue: Input String was not in a correct form” when I’m working with Flow Decisions.

My condition is “String.Lenght < 2”, and my String is = “May”. But instead of going to the False branch, it shows the error. When I switch the condition to “String.Lenght > 2”, it goes to the True branch without any error.

Any idea?

@GFlores

Can you check as the condition should be String.Length not String.Lenght

and also don’t put any double quotes

Eg: StringVariable.Length < 2
“May”.Length < 2

Hope this helps you

Thanks

hi
you can use codition like blow

Cint(String.Lenght) < 2

if it helps please mark it as a solution

Thanks…

1 Like

Sorry, it was a typo, it is actually String.Length and in my String is assigned the word “May”, that’s what I was trying to say.

No, still the same error

@GFlores

Can you take the screenshot of the If condition?

Also variable type

Thanks

Here, it is a String Array, and it literally contains the word “May”

@GFlores

Check as below

Thanks

@GFlores

Check whether you are getting the value as may correctly

check for your reference

Thanks

hi

Can you print what is dateArray(0) and put the screen shot for bettet clarity, the eeror is showing format is incorrect…

Thanks,

As I mentioned, the True branch is Ok, but try with something with 2 or less characters and let me know if it prints “False”

@GFlores

For 2 letter and check length less than equal to 2

For 1 letter

check 2 is not lessthan 2 then false

Hope this helps you

Thanks

DateArray(0)

Here it is just before showing the error

I tried with an If Activity and it worked, but I’m using Flow Decision, and it’s not working in them.

@GFlores

In Flow decision you can trim the value, maybe some whitespaces will be the problem also

String.Trim() and check

Hope this helps you

Thanks

I already tried that too and nothing happens :disappointed:

hi

i tried the same scenario in flow chart, this is working perfectly


thanks…

If true branch has no error, how about checking condition of lower flow decision?

Do you mean the flow decision that is after this one?

Yes :slight_smile: