cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2289
Views
30
Helpful
6
Replies

UCCX String/Array Variable with 10-20 values

knelson23
Level 1
Level 1

Hello, I am looking for help with taking 10-20 4-digit numbers and putting them in a variable that I can use to valid if a number is in the list.  I have ~60 4-digit # Triggers coming into my script and I need to compare the called number/trigger with a list of numbers and return say True if it exists in the list and False if it does not.  The company that is asking me to set this up currently uses If/then statements for every comparison which makes for a lot of code.  I assume there has to be a much easier way to do this?

 

I know there is a way to put the numbers in a document to do this and if that is the only way - please share how I'd parse the document.  But I'm really hoping there is a way to define the list within the script itself.

 

UCCX version: 12.0

 

Thank you.

1 Accepted Solution

Accepted Solutions

I don't have an exact canned answer, but it is something like this.

 

 

View solution in original post

6 Replies 6

I would lean towards storing the info in an XML document in CCX document store. It would be a pretty simple Xquery to parse that list. Then you could update the document without having to update the script. You also wouldn't have a limit of how many numbers you could store. It may be pessimistic, but my experience is that whatever X is for the maximum number of values always has to try and find a way to accommodate X + 1.

Hi Elliot, could you share the code to parse the list into a variable?  Here is what I tested today and works but would be better to populate the variable from the XML file for the reasons you stated.  Also, would the data in xml file be by row seperated by csv or by column?

 

UCCX Code Ex.jpg

 

 

 

The data in the XML would be stored in rows, multiple, where each value is put into an xml tag. That’s how you then form the xpath to find the value of the xml tag. @Elliot Dierksen Has provided a very good example on how to do this in the CCX editor.



Response Signature


This document over at DevNet should help you out to get started with this.



Response Signature


I don't have an exact canned answer, but it is something like this.

 

 

knelson23
Level 1
Level 1

Thank you Elliot.  Greatly appreciated.