- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on โ05-30-2022 12:28 AM
While replying to queries from users, I came across a common question which many user ask specially when they have started their ServiceNow journey and Service Catalog is the first thing they get to work on, that is
How to fetch other details of the user like department, mobile number, etc of a user when it is selected as requested_for. So below is the step by step guide to achieve the same/similar query
1. Create an OnChange client script on change of variable requested_for
- Initialize GlideAjax with the name of the script include that you want to use.
- When creating the script include, you must set the name field to be exactly the same as the class name.
- When creating the script include, you must select the Client callable check box.
- Specify the parameter sysparm_name. GlideAjax uses sysparm_name to find which function to use.
- Any extra parameters may be passed in, all of which must begin with sysparm_. Avoid using predefined parameter names:
- sysparm_name
- sysparm_function
- sysparm_value
- sysparm_type
- Code is then executed with the getXML() or getXMLWait() functions
Below is the example client script
Below is the example script include
Below is the output
You can also send an array of results using this method. Please bookmark and subscribe this article if you find it useful. As it will help you in many of your requirements
To learn more about GlideAjax follow below link
For a zero code approach you can always use the article on Catalog Data Lookup Definition
- 2,047 Views

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi there,
Have you also considered using Catalog Data Lookup Definition instead? Zero code.
Kind regards,
Mark


- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Great suggestion ๐
An hour later, they posted this: https://community.servicenow.com/community?id=community_article&sys_id=3f0cf115db7fc190847d5ac2ca961...