I have the below XML document in UCCX document management.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
When anyone call the UCCX application, script should compare the called number (CalledNumber Variable) with each DNIS row in the XML document and return true if CalledNumber and DNIS matches, if not return false if there are no matches found.
How can I achieve this? please help me on xpath to fetch the DNIS value one by one from XML so that I can compare inside my script.
Solved! Go to Solution.
Have you tried to search for this in the community? With a minimum amount of effort you should be able to find examples of this, or at least as similar that would be usable enough for you to figure out how to do this, as it’s a type of topic that has come up on many occasions.
Yes Roger. I saw many examples, but using those examples, either returning Null value to my variable in Script or Java Exceptions error while running Reactive debug. I know this is a very simple and basic thing to identify xpath, but somewhere I am missing.
Thanks Roger. Based on the video, I made some changes in my XML file and xpath, finally I got my required output.
<DNIS ID = "6022"><Number>6022</Number></DNIS>
<DNIS ID = "6023"><Number>6023</Number></DNIS>
<DNIS ID = "6024"><Number>6024</Number></DNIS>
<DNIS ID = "6025"><Number>6025</Number></DNIS>
Working xpath: /Numbers/DNIS[@ID=6022]/Number
Output is: 6022
Generic variables used in script are below:
1) String Variable, xpath1 = "//DNIS[@ID="
2) String Variable DNIS = CalledNumber (variable value)
CalledNumber value will be fetched by script get call contact info step (called number variable)
3) String Variable xpath2 = "]/Number"
Final xpath to be included in get xml document data step is xpath1 + DNIS + xpath2