- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2024 08:26 PM
If I use "GlideAjax" with the following code, will a log be saved in a table?
// client script – contains onLoad function and a callback function
function onLoad() {
var ga = new GlideAjax('GetUserInfo'); // GetUserInfo is the script include name
ga.addParam('sysparm_name','managerName'); // managerName is the function in the script include that we're calling
ga.addParam('sysparm_user_name','fred.luddy'); // set user to Fred Luddy
/* Call GetUserInfo.managerName() with user set to Fred Luddy and use the callback function ManagerParse() to return the result when ready */
ga.getXMLAnswer(ManagerParse);
}
// callback function for returning the result from the script include
function ManagerParse(response) {
alert(response);
}
// GetUserInfo script include
var GetUserInfo = Class.create();
GetUserInfo.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
managerName: function() {
var userName = this.getParameter("sysparm_user_name");
var grUser = new GlideRecord('sys_user');
grUser.get("user_name", userName);
// Build the payload. You can return additional data if needed.
var result = {
"manager": grUser.getDisplayValue('manager')
};
return JSON.stringify(result);
},
type: 'GetUserInfo'
});
I would like to check the parameters when executing the following script include:
ga.addParam('sysparm_name','managerName');
ga.addParam('sysparm_user_name','fred.luddy');
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2024 08:58 PM
what's your exact question?
GlideAjax and REST are 2 different things
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2024 08:59 PM
This will not be stored in any table. You can log these in your script include with ex -
var sysparmName = this.getParameter('sysparm_name');
var sysparmUserName = this.getParameter('sysparm_user_name');
gs.info('sysparm_name: ' + sysparmName);
gs.info('sysparm_user_name: ' + sysparmUserName);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2024 08:28 PM
Is the mechanism of "GlideAjax" similar to REST?
If so, will it be recorded in a REST-related table?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2024 08:59 PM
This will not be stored in any table. You can log these in your script include with ex -
var sysparmName = this.getParameter('sysparm_name');
var sysparmUserName = this.getParameter('sysparm_user_name');
gs.info('sysparm_name: ' + sysparmName);
gs.info('sysparm_user_name: ' + sysparmUserName);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2024 08:58 PM
what's your exact question?
GlideAjax and REST are 2 different things
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2024 10:55 PM
Hi @bonsai ,
Check below thread for understanding the glideAjax in details.
Like whats the purpose of it, how you can call, how you can return multi variables and so on..
https://servicenowwithrunjay.com/glideajax-in-servicenow/
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------