top of page

How to Dynamically Set Default Value on Date Field

With Saloni Suthar

The video features Saloni, a Technical Consultant at GlideFast, demonstrating how to dynamically set a default value for a date type field in ServiceNow. The scenario presented involves an organization wanting to set the due date on a problem task to be 30 days from the creation of the problem record.

To configure this, Saloni navigates to the problem module and selects a problem record. Then, on the problem task related tab, they click on "Root Cause Analysis." In the "Due Date" field, Salooni right-clicks and chooses "Configure Dictionary."

In the "Configure Dictionary" window, Saloni sets the default value using a dictionary overwrite. They select the "Problem Task" table and enter the JavaScript code "GS.nowDateTime() - 30" as the default value. This code sets the due date to be 30 days before the problem task creation.

After submitting the changes, Saloni goes back to the problem task and clicks on "New" for a new task. Upon opening the task, the due date is automatically set to four weeks from the problem task creation, which is 30 days from the current date.

In conclusion, the video demonstrates the process of dynamically setting a default value for a date field in ServiceNow by using a dictionary overwrite and JavaScript code. This technique allows for automated default values based on specific calculations or conditions.


About GlideFast Consulting, A Division of Apex Systems

GlideFast Consulting is an Elite ServiceNow Partner that specializes in delivering exceptional solutions on the ServiceNow platform. We pride ourselves on offering industry-leading services, unparalleled expertise, and a track record of positive customer reviews. Our extensive experience in ServiceNow, combined with our unwavering commitment to customer success, sets us apart from our competitors and enables us to deliver successful outcomes for every client. Whether it's our deep platform knowledge, process-driven standardization, or innovative approach, we are dedicated to providing our customers with the best possible experience. Reach out to our team here.

76 views0 comments

Recent Posts

See All
bottom of page