getXMLText in scoped application

Lohith
Giga Expert

Hi Team,

am getting XML response in REST Post method. am in scoped application. am not able to fetch the values from the XML response. i have parsed the response.

var xmlDoc = new XMLDocument2();
xmlDoc.parseXML(responseBody.toString());

var nodeValue= gs.getXMLText(xmlDoc, 'node tag');
any alternative for getXMLText in scoped application.

Appreciate your inputs.

Thanks,

Lohith

1 ACCEPTED SOLUTION

Hi Ankur,

 

Yes, i was able to achieve with the below code.

var xmlDoc = new XMLDocument2();
xmlDoc.parseXML(responseBody.toString());

xmlDoc.getNodeText(// node name);

 

Thanks,

Lohith

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Lohith,

Can you share the sample xml received so that the script can be created.

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Lohith,

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

 

Yes, i was able to achieve with the below code.

var xmlDoc = new XMLDocument2();
xmlDoc.parseXML(responseBody.toString());

xmlDoc.getNodeText(// node name);

 

Thanks,

Lohith