cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1200
Views
0
Helpful
4
Replies

UCCX 12.0 Zip Code XML file lookup

bphillips1972
Level 1
Level 1

Hello, my company is looking to route callers to specific CSQ's based on zip code. I already have the caller entering their zip code and I am storing it in a variable, that part works. I also have an XML document in the repositaory that looks like this:

 

<?xml version="1.0" encoding="UTF-8" standalone="true"?>

-<data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


-<record>

<ZipCode>95757</ZipCode>

<Region>1</Region>

</record>


-<record>

<ZipCode>95814</ZipCode>

<Region>2</Region>

</record>

</data-set>

 

All I want to do is take the Zip Code, already stored in a variable, look it up in the xml file and send back the Region number (in a variable) so that I can then route different region numbers to different CSQ's. I have tried the Get XML document steps and dont really get it. Thanks for any help you can provide.

 

1 Accepted Solution

Accepted Solutions

Yes you do, and it "preps" the XML document to be parsed, to put it simply. There are no parameters needed.

The Document variable, say it was named xml, would be set like this: DOC[zipcodes.xml] and that is a reference to the document in the repo. Then in the Create XML Document step, just put the xml variable in both spots: top and bottom, and leave the middle field blank. That's it.

View solution in original post

4 Replies 4

Anthony Holloway
Cisco Employee
Cisco Employee

I'm assuming a few things here, but in the Get XML Document Data step you would need:

 

  1. The XML Document you used in the Create XML Document step
  2. An XPATH expression to find the Region based on the ZIP code
  3. A String variable to hold the results of the step

 

The part you are most likely having the toughest time with is the XPATH expression.  Let's assume you got the ZIP Code from the caller in a variable called zipcode.  Then let's assume you had a String variable to store the results in called region.

 

"//record[zipcode=" + zipcode + "]/region"

Then, just to be sure the results came back, you could do the following:

 

If (region != null && region.trim() != "")
  True
    /* The search worked! */
  False
    /* No match found */

 

Now, I'm not sure what you have in mind for mapping a region number to a CSQ, but I'll leave that up to you to decide if you need help with that or not.

Super helpful, yes, i was really confused on the expression. One other question, do i need a "create xml file" step even though i already have the xml file uploaded into the document repository on uccx? If so, what does it do and what are the parameters?

Yes you do, and it "preps" the XML document to be parsed, to put it simply. There are no parameters needed.

The Document variable, say it was named xml, would be set like this: DOC[zipcodes.xml] and that is a reference to the document in the repo. Then in the Create XML Document step, just put the xml variable in both spots: top and bottom, and leave the middle field blank. That's it.

For what reason are you posting an answer on a four years old post that is marked as solved?



Response Signature