10-08-2019 03:28 PM
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.
Solved! Go to Solution.
10-08-2019 06:06 PM
10-08-2019 05:28 PM
I'm assuming a few things here, but in the Get XML Document Data step you would need:
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.
10-08-2019 05:53 PM
10-08-2019 06:06 PM
08-30-2023 12:53 PM
For what reason are you posting an answer on a four years old post that is marked as solved?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide