
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2017 07:27 AM
Hello everyone,
I am aware of how to use GlideAjax to return JSON, but for my own knowledge I am working on building out the same scripts just returning XML strings. In my client script I need to convert that string to an object so that I can perform some action with it. I found a Script Include in SN called XMLHelper that has a method called toObject() that does this.
Unfortunately I am not having any success with it. I wasn't sure if this Script Include could only be accessed server-side (I noticed that OOB in my PDI the "Client Callable" checklist is unchecked. Just for fun I checked it and tried to call that method in my GlideAjax client script, to no success.
Am I going about this all wrong? Is XMLHelper not intended to be called by a client? Is XMLHelper deprecated?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2017 05:28 AM
Hi Sean,
Ok got it. But in ideal case you should parse the xmlstring in serverside. You can refer below links where they say they have done parsing in client side.
Parse XML using JavaScript - Stack Overflow
If this helps to solve your query then please mark the answer as correct and also mark it as helpful.
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
04-24-2017 02:37 AM
Hi Sean,
Not sure what you are trying to achieve. if the script include which is Out of the box and is having client callable unchecked then there must be some purpose in having the client callable flag as unchecked. So avoid updating the out of box script includes etc
Below links you can go through:
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2017 03:29 AM
Hi Ankur. My question is mostly academic. I am just wondering if I should be able to call the XMLHelper from the client to parse an XML string into an object
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2017 05:28 AM
Hi Sean,
Ok got it. But in ideal case you should parse the xmlstring in serverside. You can refer below links where they say they have done parsing in client side.
Parse XML using JavaScript - Stack Overflow
If this helps to solve your query then please mark the answer as correct and also mark it as helpful.
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
04-28-2017 12:11 PM
Thank you Ankur, I think I was thinking about this all wrong. I have left off trying to use XMLHelper on the client or server side.