Set default value with current logged in user in dictionary override
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 09:19 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 09:27 AM - edited 05-15-2023 09:27 AM
Hi,
Here is an example
Find the dictionary entry and open it -> and click on dictionary override related list and click new
Fill the form as below and submit
Done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 10:03 AM
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:
- Open the ServiceNow instance and navigate to the Task table's dictionary.
- Locate the field for which you want to set the default value.
- Click on the field to edit its properties.
- In the "Default Value" field, enter the following script:
javascript: gs.getUserID();
This script retrieves the ID of the current logged-in user.
- Save the changes.
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi