Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

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

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?

BR

5 REPLIES
VIP Super Bronze

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

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.

Example:

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

Set callingNumber = "6767"

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

  True

    Your logic here.

  False

    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.

New Member

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

Hi, Jonathan

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

When i could be do this steps inside script editor?

VIP Super Bronze

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

I don't understand what you are asking. I gave you exact steps and expression logic to use.

New Member

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

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

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

VIP Super Bronze

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

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.

177
Views
5
Helpful
5
Replies
CreatePlease to create content