Set default value with current logged in user in dictionary override

Vinay49
Tera Expert

There is one field in change form which is created on task table. Requirement is that set that field default value as current logged in user.

 

Looking for help to add default values in dictionary override.

 

Thanks in advance.

2 REPLIES 2

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Here is an example

Find the dictionary entry and open it -> and click on dictionary override related list and click new

AnuragTripathi_0-1684167989833.png

Fill the form as below and submit

AnuragTripathi_2-1684168068435.png

 

 

Done

 

 

 

 

 

 

-Anurag

Amit Gujarathi
Giga Sage
Giga Sage

HI @Vinay49 ,
I trust you are doing great.

 

To achieve this, you can use a dictionary override. A dictionary override allows you to customize the behavior of a field, including setting default values. Here's how you can do it:

  1. Open the ServiceNow instance and navigate to the Task table's dictionary.
  2. Locate the field for which you want to set the default value.
  3. Click on the field to edit its properties.
  4. In the "Default Value" field, enter the following script:

 

javascript: gs.getUserID();

 

This script retrieves the ID of the current logged-in user.

  1. Save the changes.

 


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi