parsing a XML document

naresh1019
Mega Expert

can you please guide me on this.

1) I created a Soap OutBound Message.

2) recieved a long response(xml) for a given request.

3) i want to put this in a scheduled job.

4) I want to extract the a single node data from that and push it into cutom table.

5) I copied the preview script and pasted in scheduled script.

5) I want to parse the xml data and extrat the contents of the perticular node.

find_real_file.png

Please guide me on extracting the node data.

find_real_file.png

14 REPLIES 14

Gowrisankar Sat
Tera Guru

Hi Naresh,



Try this:



response is xml string.


              var xmldoc = new XMLDocument(response);


                              var result = xmldoc.getNodeText('//GetPorfoliosResponse/PortfolioDescriptor/PortfolioName');


Can we use.....xmldocument2



On Dec 15, 2017 1:31 AM, "gowrisankar" <community-no-reply@servicenow.com>


yes you can. check the below link for examples:



XMLDocument2 - Scoped


More over there are 20 data fields in the complete XML, I need to capture


all



On Dec 15, 2017 1:44 AM, "gowrisankar" <community-no-reply@servicenow.com>