cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
601
Views
5
Helpful
4
Replies

Get XML Document Data based on two values

wimhasselo
Level 1
Level 1

Hi,

I trying to read a XML document.

I need the value onCaller_Mail where onCaller_Group=A and onCaller_DN=5002 (see xml sample at the bottem)

I tried:

response=get XML Document Data("//onCaller[(onCaller_DN='"5002"') && (onCaller_groep='"A"') ]/onCaller_Mail")

but I get an error:-(

 

when I try a single check is works fine.

response=get XML Document Data("//onCaller[onCaller_DN='"5002"') ]/onCaller_Mail")

 

Someone any idea?

 

Thanks in advance,

 

Wim

================================================================================

<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" generated="2019-01-18T17:41:34">
<onCaller>
<onCaller_ID>60</onCaller_ID>
<onCaller_groep>A</onCaller_groep>
<onCaller_groepDN>5000</onCaller_groepDN>
<onCaller_Mail>mail01</onCaller_Mail>
<onCaller_DN>5001</onCaller_DN>
</onCaller>
<onCaller>
<onCaller_ID>61</onCaller_ID>
<onCaller_groep>A</onCaller_groep>
<onCaller_groepDN>5000</onCaller_groepDN>
<onCaller_Mail>mail02</onCaller_Mail>
<onCaller_DN>5002</onCaller_DN>
</onCaller>
</dataroot>

4 Replies 4

Anthony Holloway
Cisco Employee
Cisco Employee

According to an online XPATH testing tool, this should work:

 

//*[onCaller_DN='5001' and onCaller_groep='A']/onCaller_Mail

 

And if you need to use this in your step with some variables, then it would look like this (assuming variable names here):

 

"//*[onCaller_DN='" + dn + "' and onCaller_groep='" + 
groep + "']/onCaller_Mail"

 

PS, I didn't know how to do this either, so I searched for xpath syntax, which brought me to this page, and then I searched for xpath predicate and operator, which brought me to this page.  I have not tested this in UCCX, but it makes sense to me that it would work.  Let me know if it works!

 

Hi Anthony,
Sorry for the late response...you moved me into the right direction.
This is how it finally worked:

S_onCallerDN = Get XML Document Data(D_onCallers, "//onCaller[onCaller_DN='" + Cl_Calling_Number + "' and onCaller_groepDN='" + Cl_Original_Called_Number + "' ]/onCaller_DN")

Thanks for your help.

With kind regards, Wim

Awesome!

tom.miller1
Level 1
Level 1
 
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: