ā08-14-2014 09:37 AM
Simple question I think?
But I don't see a way using the decision editor to check if a variable is blank or null?
I can write a simple java action element to check, but is there a way to do this without using some simple java custom code?
Gerard
Solved! Go to Solution.
ā08-14-2014 11:15 AM
Gerard,
May seem clunky but you can append another character ($, for example) and then test whether the resultant string starts with it.
ā08-14-2014 09:41 AM
You can use the decision editor and use cargument type call data and call data type ani and use operator does not exist.
Hemal
ā08-14-2014 09:46 AM
Ahh, I thought that would check if the actual variable exists or not and not the value of the variable itself.
Thanks for the tip. I will give it a test and see.
Gerard
ā08-14-2014 10:14 AM
It turns out that with VXML Server, if you set a variable value to NULL
then VXML Server deletes the variable.
So you'll never have a session or call data variable that exists with a
NULL value.
ā08-14-2014 10:19 AM
I found if I set a variable in ICM and send it to CVP, even if it has not value it does "exist".
So the above tip from Helma does not work.
If ANI is restricted ani, gets set to "anoymous", so I can use this in this case...
But for the more general case, where a session variable has a string value of "",
it would be nice if you could test this without a custom java code.
Gerard.
ā08-14-2014 10:22 AM
Use the same decision editor to test a string value equal to "". Use operator equals string.
Hemal
ā08-14-2014 10:25 AM
I already had tried that. Not allowed!
Gerard
ā08-14-2014 10:59 AM
What do you mean by not allowed. I tested it works for me.
Hemal
ā08-14-2014 11:33 AM
Ok, I get what you are saying. All you need to is create a string in the session equal to empty string "" and then check against that session variable.
Hemal
ā08-14-2014 10:26 AM
Another option would be a translation of the caller number on the gateway, before the call ever gets to CVP.
-Jameson
ā08-14-2014 11:15 AM
Gerard,
May seem clunky but you can append another character ($, for example) and then test whether the resultant string starts with it.
ā08-15-2014 01:14 AM
Thanks all for very useful answers.
Hemal it is not possible to create a session variable in CVP Studio equal to a blank value, CVP Studio will not allow it.
But using Paul approach and your approach I did the following.
1) in ICM set the microapp.ToExt[0] to "application=CVP_Test_App;variable1="
2) we want to test if the session variable "variable1" is blank or not (it is blank in above example).
3) create a session variable "IsVariable1Empty" in CVP Studio which equals "{Data.Session.variable1}$$$
4) using decision Editor check if "IsVariable1Empty" equal the constant string "$$$"
5) If it is, variable1 is empty, if not, its not.
Thanks again for everyone's help on this.
Gerard.
ā08-14-2014 02:29 PM
Try this, first define your decision using Decision editor.
in the same node instead of using decision editor choose XML.
on your preferable exit state do edit XML and put "" there. (that will make it null).
Chintan
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide