- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 09:20 PM
How to solve the above problem, using client script methods g_form and g_user only
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 09:25 PM
Hi @pk16514
it's not recommended to do this on client-side as the code might not work in all experiences. Instead, do this in the catalog item. The following article explains how to do that: https://blog.snowycode.com/post/how-to-auto-populate-the-current-user-in-servicenow
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 09:33 PM
Hello @pk16514 ,
Instead of using client script. You can populated email and phone number by using default value.
Add below in default value to that variables :
javascript:gs.getUser().getRecord().getValue('phone_number');//phone number
javascript:gs.getUser().getRecord().getValue('email');//email
Please Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Regards,
Vaishnavi Shinde
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2024 04:45 AM
Hi @pk16514
Use the Auto populate feature on SN release in Utah.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************