
- 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-29-2017 12:08 AM
Ok Sean,
Could you also mark the answer as helpful and hit like. Thanks in advance
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader