Scripting-Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2025 10:30 PM
Hi,
Can anyone explain me what does the below line return?
var variable_name = response.responseXML.documentElement.getAttribute("variable_name");
////////.......... some piece of code
}
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2025 10:37 PM
it's a syntax to get the value from AJAX function
Nowadays we use getXMLAnswer() syntax to get the value from ajax
var ga = new GlideAjax('checkRecords');
ga.addParam('sysparm_name', "checkRecordPresent");
ga.addParam('sysparm_userID', g_form.getValue('user_id_variable')); // give here user_id variable name
ga.getXMLAnswer(function(answer){
aler(answer); // this gives you the response
});
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-01-2025 12:09 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2025 10:40 PM
Hi @Nandhinisri ,This is the callback function executed after the GlideAjax call. It retrieves whatever value is returned by the client-callable script include.
Please see : GlideAjax Example Cheat Sheet - ServiceNow Community
If you can provide screenshots of the script include and client-side script, I can give a more precise answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2025 11:34 PM
The link provided is useful. Thanks