- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2019 08:12 AM
I am creating a scoped application that will be making several web service calls to populate data on the form. The web service is being called by a script include. I am building a choice list with the results in a client script. This service can have multiple Record elements. How can I build an array from this response in a scoped application?
<ns0:Record>
<ns0:String1>99</ns0:String1>
<ns0:String2>99999999999</ns0:String2>
<ns0:String3>Words</ns0:String3>
</ns0:Record>
<ns0:Record>
<ns0:String1>98</ns0:String1>
<ns0:String2>99999999998</ns0:String2>
<ns0:String3>Words</ns0:String3>
</ns0:Record>
<ns0:Record>
<ns0:String1>97</ns0:String1>
<ns0:String2>99999999997</ns0:String2>
<ns0:String3>Words</ns0:String3>
</ns0:Record>
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2019 01:35 PM
I converted the xml to json and parsed the json.
var obj = gs.xmlToJSON(answer);
var myObj = JSON.parse(JSON.stringify(obj).replace(/ns0:/g, ""));
var myNewObj = JSON.parse(JSON.stringify(myObj).replace(/soap:/g, ""));
var length = myNewObj.Envelope.Body.Response.Rec.length;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2019 08:19 AM
Please check solution below to build array from SOAP response
Regards,
sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2019 08:30 AM
XMLDocument is not supported in a scoped application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2019 01:35 PM
I converted the xml to json and parsed the json.
var obj = gs.xmlToJSON(answer);
var myObj = JSON.parse(JSON.stringify(obj).replace(/ns0:/g, ""));
var myNewObj = JSON.parse(JSON.stringify(myObj).replace(/soap:/g, ""));
var length = myNewObj.Envelope.Body.Response.Rec.length;