Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2024 01:13 AM
Hello Team
sys_user table have some uers who has two profile with same name one with normal user id like 123xxx and other profile is with hyphen userid like aba-234
user are login servicenow with normal user id .
in a catalouge item one varible need to populate name of current login user which is associated with hyphen id
i wrote that scrip but not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2024 01:28 AM - edited 09-08-2024 01:29 AM
Hello @Shrabanti ,
Considering this variable of type reference to sys_user table, you can set default value to -
javascript:gs.getUserID();
Replace : with :
It will show logged in user's name.
If my response helps you in any way, kindly mark this as Accepted Solution/Helpful and help in closing this thread.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2024 01:50 AM
hello
i want to populate that second user profile with hyphen userid not that login user one
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2024 01:34 AM
Hello @Shrabanti ,
You can paste the below code in the default value section of the variable.
javascript: gs.getUserDisplayName();
Please accept my solution and give thumbs up, if it helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2024 01:38 AM
Hello @Shrabanti ,
You can refer the below screenshot, that is definitely going to help you.
Please accept my solution and give thumbs up, if it helps you.