- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2020 03:28 AM
Hi All,
I need to fetch a value from the response body which i have received it from the SOAP step:
Fig:
Can some help me how do i fetch any value from the xml response which i am getting in the responsebody input variable?
Thanks,
Ak
Solved! Go to Solution.
- Labels:
-
flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2020 11:34 AM
So the problem is the body which is returned from integration.
See formatted XML
Below works but it's not good for long time solution.
var response = inputs.response_body.toString();
var xmldoc = new XMLDocument(response);
if(xmldoc.toString().indexOf('name=') > -1){
var nm1 = (xmldoc.toString().split('name="')[1]);
var nm2 = (nm1.toString().split('"')[0]);
outputs.groupname = nm2;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2020 08:39 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2020 09:26 AM
try below and see what you get in logs
var response = inputs.response_body.toString();
gs.log("response: " + response, "Soap");
var xmldoc = new XMLDocument(response);
gs.log("xmldoc: " +xmldoc, "Soap");
var name = xmldoc.getNodeText("//row/@name")
gs.log("name: "+name, "Soap");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2020 09:47 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2020 09:58 AM
Can you copy that xml and share, I can test something and if it works then I'll let you know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2020 10:15 AM
response:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetSupportSpecialistByLocationResponse xmlns="http://nda.acml.com/"><GetSupportSpecialistByLocationResult><nda-response id="getassociations" status="OK"><association from_entity_guid="12345D3E-AFD1-19B1-1FD0-R3R0BF3A11EB1" business_process_role_guid="12345D3E-AFD1-19B1-1FD0-R3R0BF3A11EB1"><people></people><groups><row group_guid="12345D3E-AFD1-19B1-1FD0-R3R0BF3A11EB1" name="IND -BLR" email="indblr@example.com" ordinal="0" description="" association_guid="12345D3E-AFD1-19B1-1FD0-R3R0BF3A11EB1"/></groups></association></nda-response></GetSupportSpecialistByLocationResult></GetSupportSpecialistByLocationResponse></soap:Body></soap:Envelope>