- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 06:56 AM
Firstly I am no coder, so if you are able to help please ELI5.
On a Catalog item I have two variable in a variable set called Service Now User Details they are 1) requested_for and is reference on the sys_user table and has a default value of requested_for -> javascript: gs.getUserID(); 2) The second variable is called email_address again a reference on the sys_user table with a default value of javascript:gs.getUser().getEmail();. I need to do something similar for country code from the users record.
My desired result when I 'Try' the item is that I get an empty field for Requested For and once I look up a user and select them the email address will autopopulate. with their email address and country code
I've read loads of community posts and mostly they refer to client scripts and occasionally to glide ajax but can't get my head around it!
Also if I client script is required is that added to the variable set Catalog Client Script section or to the item Catalog Client Script section.
Hope this makes sense but any questions plase ask
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 06:59 AM
Hi there,
Maybe this helps:
- 2021-02-11 Catalog Data Lookup Definition on any table, eliminating Catalog Client Scripting
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 06:59 AM
Hi there,
Maybe this helps:
- 2021-02-11 Catalog Data Lookup Definition on any table, eliminating Catalog Client Scripting
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 07:00 AM
Thanks I'll take a look
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 06:59 AM
Great

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 07:02 AM
Hi
There are 2 ways of looking at it.
1. If you auto-populate Requested for then you can get other fields populated to
2. If you want to get them populated based on Requested for value or on change of requested for then you can write Client Script(Onchange) in Variable set itself.
3. You can also have catalog definition lookup where you dont need client script at all.
Hope this helps
Thank you
Prasad