cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

785
Views
10
Helpful
1
Replies
tsutton31
Beginner

Can not find starts with function in UCCX

Folks,

            I am writing a script which will forward the call to the operator if the called number is 1234.

When I use the IF statement , I am unable to find contains or starts with function in UCCX editor.

Can anyone tell me under which menu I can find it please.

Thanks

1 REPLY 1
Anthony Holloway
Cisco Employee

EDIT: You did not mention what license model you have on UCCX.  Standard will not have these methods available, only Enhanced and Premium.

Long Answer

The first thing you should know is, this method you are looking for is a Java String method.

So googling "java string methods" would return a result for the Java documentation for Java String:

http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html

Then if you scroll down in that list, you will see that there is no "contains" method, but there is a "indexOf" method:

http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#indexOf%28java.lang.String%29

This method will tell you the position within your string in which the test string is found.  If it's not found a value of -1 will be returned.  So, if you wanted to know if a certain string exists within another, you simply check for a return value of -1; which means it does not.

If you scroll down a little further, you'll see there is a "startsWith" method:

http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#startsWith%28java.lang.String%29

This method simply returns TRUE or FALSE for whether or not your string begins with your test string.  This one is pretty simply.

Short Answer

if (called_number.startsWith("1234"))

  true

    /* Called Number Starts With 1234 */

  false

    /* Called Number Does Not Start With 1234 */

if (called_number.indexOf("1234") >= 0)

  true

    /* Called Number Contains 1234 */

  false

    /* Called Number Does Not Contain 1234 */

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Create
Recognize Your Peers
Content for Community-Ad