i want to populate a requester as a current log in user in a service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 07:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 11:42 AM
If your requestor field is a reference field to 'sys_user' field then in the default value of the requestor field put
javascript:gs.getUserID();
it will auto-populate the current logged-in user name.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 11:43 AM
Set the default value of the field to like in the screenshot below.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 11:48 AM
Hello @Kunal Balode
You need to use the gs.getUserID() method.
A sample code is:
- Create an onload client script on the form that is supposed to populate the field.
- Enter the code as:
function onLoad()
{ var userID = g_user.userID; if (g_form.getValue('caller_id') == '') g_form.setValue('caller_id', userID); }
Here we are assuming caller_id is the field on the form that is supposed to populate the value.
You need to check this on your instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 11:59 AM
Check this out:
Please mark my response as correct and helpful if it helped solved your question.
-Thanks