What is best way to get Server-Side information on a Catalog Client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 10:18 AM
I have a Catalog Client Script which need to pull information from a Server-side table, and I have two ways to do that one is through Script include call and second is call back function.
What would one to use and which is better.
Call back function example -
var ga = new GlideAjax('MyScriptInclude');
ga.addParam('sysparm_name', 'getDetails');
ga.addParam('sysparm_user_id', userId);
ga.getXMLAnswer(function(response) {
var data = JSON.parse(response);
g_form.setValue('my_field', data.some_value);
});

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 10:21 AM
Hi,
Do you mean option between call back and without call back function?
My recommendation is to use call back function as Service Portal supports only the GlideAjax with call back function
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 11:15 AM
Hi @Ashish Kathait,
Please see below table for detailed comparison of both callbacks:
getXMLAnswer | You want a clean, simple value | Easy, reusable |
getXML | You want more complex logic or XML parsing | Flexible |
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P