how to use ten or more posibles values in string variables?

Unanswered Question
Jun 21st, 2010

Hello !

Using UCCX 7.0 script editor how i can use ten or more posibles values in string variables?, for example

i´m try to do this:

If caller id is: 6767 compare with variable "number"

i want to variable number = 8900 or 6767or 8742 or 8812

variable number is string.

What can i do?


I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Jonathan Schulenberg Mon, 06/21/2010 - 11:04

Well there's a few ways of going about this. This is more of a Java programing question than a CCX question though.

One of the easier ways would be to just create a String-type variable with a comma separated list of values you want (e.g.  myString = "8900,6767,8742,8812"). From that you can use the Java .indexOf(String str) method to find the pattern you want within the variable.


Set myString = "8900,6767,8742,8812"

Set callingNumber = "6767"

If (myString.indexOf(callingNumber) >= 0)


    Your logic here.


    Your logic here.

Essentially, the indexOf method will return an integer value of the first occurrence within the String variable of the given pattern. In this case you don't care about this, what you care about is what happens if it doesn't find that pattern. In that case it returns a -1 value.

Most people use a Switch (Match Case) statement here and just list out the individual matching conditions they want. Without knowing the use case it's hard to tell you what the best way forward is.

diegorgarces Mon, 06/21/2010 - 12:08

Hi, Jonathan

Thank you, but can you be more explicit with the procedure?

When i could be do this steps inside script editor?

diegorgarces Mon, 06/21/2010 - 12:43

I know now, im a little confused when you talk me about java.

But now it´s working. Thank you very much !!!!!

Jonathan Schulenberg Mon, 06/21/2010 - 12:46

Ah ok.  The CCX script is actually Java with a pretty UI slapped on top of it to make it easier for folks. The expression logic and anything fancy is where you need to break out "real" Java code is all.


This Discussion