
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 05:40 AM
Hi All,
How do i parse an xml response that i get from soap message ?
I want the sys_id from the response.
EX- i got a following response:
<?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><insertResponse xmlns="http://www.service-now.com/u_fetch_incidents_19057"><sys_id>62c20f0edb222200d17ad6fdbf9619d5</sys_id><table>incident</table><display_name>number</display_name><display_value>ABC0010111</display_value><status>inserted</status></insertResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
I want the value of the sys id that i have highlighted to be used ahead in my code.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2018 11:45 PM
Hello Vineetha Rohra,
I have store your response in one field and written business rule according to your requirement its working fine.
script:--
var res=current.getValue('u_response');
var xmlDoc = new XMLDocument2();
xmlDoc.parseXML(res);//you can user response body here.
var num = xmlDoc.getNodeText('//sys_id');//here you write whta you want from response.
gs.addInfoMessage(num);
HOPE THIS HELPFUL!!!!! MARK CORRECT OR HELPFUL.
Thanks,
Mohammed Iqbal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 01:51 AM
Hi Vineetha,
Any update on this?
Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2019 06:41 AM
Hi Mohammad,
In my case, response is a Session token which I got after logging in to target system. I want to store it in a variable on form for further use it for subsequent calls. How I can do that?
Thanks,
Nitin