cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ridch01
Level 5

Evaluate empty string

Is there an easy way to evaluate if a user input string is empty? I have a dialog prompt in which the user is asked to input a value. They can leave the value blank. I could implement a Custom Rule to handle this - but I have to think there is an easier way.
Labels (1)
0 Kudos
(2) Replies
james_decosta
Level 9

hi,
you can add a rule----
choose installanywhere variable.
You know the name of your variable say

use like this
$USER_INPUT_RESULT_2$ does not equal $NULL$
or you can even use like this
$USER_INPUT_RESULT_2$ does not equal $EMPTY_STRING$

In installer $EMPTY_STRING$ and $NULL$ are equal
0 Kudos
ridch01
Level 5

I wasn't able to use $EMPTY_STRING$ or $NULL$ in the rule. Instead, I had to say:
$MY_VARIABLE$ equals ""

I wrote out the variables to a file and noticed that they add double quotes around strings. I'm not sure if I like this or not (since we will likely have to strip the quotes when we use the data later). Anyway, one more problem resolved.
0 Kudos