How to auto populate the name and email of the current user in service catalog using the catalog client scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2022 01:20 AM
How to auto populate the name and email of the current user in service catalog using the catalog client scripts
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2022 01:22 AM
Hi there,
You might consider using the default value of the variables. Or perhaps Catalog Data Lookup Definition. Don't see a reason for Catalog Client Script here.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 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-22-2022 01:27 AM
Hi Mohan,
I answered a very similar question just the other day. See below link.
Rather than call client scripts such, set the default values for each field by configuring the variable (Right client and set the default value for each field/variable)
For the email field, set the default value to: javascript: gs.getUser().getEmail();
For the name field, set the default value to: javascript: gs.getUserID()
These will work on both the catalog native view and the Service Portal.
Please mark correct and/or helpful.
Thanks,
Robbie
Similar question: https://community.servicenow.com/community?id=community_question&sys_id=78efc5b4db318910dd886c8e1396194f
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2022 03:15 AM
Hi Mohan,
Just circling back on this. Did you see my response?
So as to help others, please mark correct and/or helpful.
Thanks,
Robbie