cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1503
Views
10
Helpful
5
Replies

splitting a string variable in UCCX

jfhandfield
Level 1
Level 1

I'm currently using UCCX Express 10.5 and I can't seem to find how to split a String variable. Every time I tried to use the reactive script I get a message saying it can't be reach like when I do something bad in the script. I'm posting my script here so if anyone can tell me what I'm doing wrong I would appreciate. I'm trying to split my openinghours that I get in a XML that are seperated by a ","

 

Thank you 

Capture.PNG

1 Accepted Solution

Accepted Solutions

Oooooh, you must have UCCX Standard Licenses, correct? If so, then the only way around this, that I know of, is to purchase UCCX Enhanced Licenses, where Java methods like String.split() are available.

View solution in original post

5 Replies 5

Anthony Holloway
Cisco Employee
Cisco Employee

Is this TimeCheck.aef script being called as a Subflow from another script? If so, you cannot reactive debug subflow invoked scripts; thta's just a limitation of the Editor.

 

Instead, you can use Active Debug, which you can start by pressing F5 or F10 on your keyboard; there are also buttons in the tool bar for this too, as seen in my screenshot below.

 

uccx-string-split.png

 

The way you split a string is already in your script: variable.split(delimeter).

 

The one tricky piece is that you cannot validate that this is correct, because you cannot debug it.

 

 

Hey Anthony,

 

  Thank you for the quick comeback and sorry for the late answer back. I tried using your script and trying the active debugging and this is the error I get when I press the F5 to start the script : 

 

Java extensions are not licensed to support method invocations (line1, col 1); nested exception is:

com.cisco.expression.ExpressionLicenseViolationException: Java extensions are not licensed to support method invocations.

 

If I remove the .split function the script doesn't give me that problem. Is there any workaround that ?

 

Thank you for the help.

 

Oooooh, you must have UCCX Standard Licenses, correct? If so, then the only way around this, that I know of, is to purchase UCCX Enhanced Licenses, where Java methods like String.split() are available.

Hi  Anthony

 

could you please give me some directions on splitting up the below string.  Im doing a SOAP request and response that im getting a string back

<soap:Body>
      <GetDeliveryDateResponse xmlns="http://ws.masonite.com/">
         <Results>2/14/2019|O30965219|9042258133|1|2748</Results>
      </GetDeliveryDateResponse>
   </soap:Body>
</soap:Envelope>
 
 
Im im dumping the string to a var.  but i need to chop it up 2/14/2019 = var s_deldate, O30965219 = var s_confirmationNum,  and so on for the 3 areas.  and advice would be helpful
 

Sure, try using yourvariable.split("\|") (Note the escaping of the pipe symbol)

Then, you could actually just use the Set step, to set a String Array vairable with all of the parts, and access each element like this:

Set mystringarray = yourvariable.split("\|")
Set s_deldate = mystringarray[0]
Set s_confirmationNum = mystringarray[1]