- 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-07-2020 09:56 AM
Hello Ak,
Did you create a variable with group name under output variable section in a script step? If not please create a output variable with name as groupname.
- Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2020 10:03 AM
Hi
Yes, i have created it..
From the SOAP step i am getting an response like this:
<?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.sys.com/">
<GetSupportSpecialistByLocationResult>
<nda-response id="getassociations" status="OK">
<association>
<people></people>
<groups>
<row name="India - Banaglore" email="indbgl@xyz.com" />
</groups>
</association>
</nda-response>
</GetSupportSpecialistByLocationResult>
</GetSupportSpecialistByLocationResponse>
</soap:Body>
</soap:Envelope>
from this i want to fetch "India - Banaglore" and pass it to the Outputs.groupname
which i am not able to achieve it.
Regards,
Ak

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2020 10:48 AM
Hi Ak
This Thread might help you.
You can create a JSON object to return multiple values like below
var obj = {};
obj.approver = gr.manager.toString();
obj.approver = gr.user1.toString();
obj.approver = gr.user2.toString();
do refer the below links
Please Mark Correct and Helpful
Thanks and Regards
Gaurav Shirsat

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2020 01:00 PM
try doing instead of gs.print map it to whichever field you want.
var response = inputs.response_body;
var xmldoc = new XMLDocument(response);
var name = xmldoc.getNodeText("//row/@name")
gs.print(name);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2020 07:47 PM
Hey
I am not able to map it.
Execution detail: