servicenow function field current date

"Get Current Date in ServiceNow Function Field"

By David Young
AD

When working with ServiceNow, you might find yourself needing to capture and display the current date in a function field. To assist with this, ServiceNow offers built-in date functions that allow you to accomplish this task with ease. Let's delve into this process, exploring how to utilize current date functions and how they can be incorporated into your workflows.

First and foremost, understanding the available date functions is crucial. ServiceNow provides a variety of functions such as Now(), Today(), ThisYear(), and ThisMonth() – each serving a specific purpose in retrieving the current date and time.

Understanding and Utilizing ServiceNow Date Functions

Before we dive into utilizing these functions in a field, it's essential to grasp their distinct functionalities.

AD
How to Break Into ServiceNow in 2026
How to Break Into ServiceNow in 2026
the servicenow logo on a dark background
the servicenow logo on a dark background
#stocks #investing #investment
#stocks #investing #investment

The Now() function retrieves the current date and time, while Today() captures just the current date. ThisYear() and ThisMonth() focus on the year and month, respectively, at the time of execution. Understanding these differences will help you choose the right function for your specific use case.

Using Now() – Retrieving Current Date and Time

If you need both the current date and time, the Now() function is your go-to. It retrieves the current date and time, formatted as a string. For instance, using sys now() in a field will display the current date and time, such as '2022-01-25T12:34:56'.

ServiceNow App Development: Simplifying Service Management on the Go
ServiceNow App Development: Simplifying Service Management on the Go
What is ServiceNow?
What is ServiceNow?
ServiceNow Event Management
ServiceNow Event Management

Example: To display the current date and time in a text field, use the expression: sys now().

Using Today() – Retrieving Current Date Only

When you only need the current date, the Today() function is most appropriate. It returns the current date as a formatted string. For example, sys today() in a field will display the current date, like '2022-01-25'.

AD

Example: To display the current date in a date field, use the expression: sys today().

How To Learn ServiceNow Skills to Grow Your IT Career?
How To Learn ServiceNow Skills to Grow Your IT Career?
ServiceNow ITSM KPIs Every Professional Should Know
ServiceNow ITSM KPIs Every Professional Should Know
ServiceNow Development Roadmap
ServiceNow Development Roadmap
ServiceNow Tutorial: A Beginner’s Guide
ServiceNow Tutorial: A Beginner’s Guide
ServiceNow Scripting Locations
ServiceNow Scripting Locations
ServiceNow IT Service Management (ITSM): Your All-in-One Toolkit for Modern IT Excellence
ServiceNow IT Service Management (ITSM): Your All-in-One Toolkit for Modern IT Excellence

Incorporating Current Date in Workflows

ServiceNow's date functions aren't just restricted to fields. They can also be employed in workflows, scripts, and more, providing dynamic date references in your processes.

For example, you can set a start date for a task to today using the Today() function. This ensures that the task commences on the current date, keeping your workflows automatically synchronized with the present time.

AD

Setting a Form's Submit Date

Automatically setting a form's submit date to the current date upon submission can be achieved with the sysidió() function. This is particularly useful in tracking submissions where maintaining the exact timestamp is important.

Service Portfolio Management (SPM) with ServiceNow
Service Portfolio Management (SPM) with ServiceNow

Example: In a submit workflow, use the expression: sysidió() to set the submit date to the current date and time.

By mastering ServiceNow's current date functions and understanding how to apply them, you can considerably enhance your processes' efficiency and automation. So, go ahead and leverage these functionalities to streamline your tasks and workflows for a more productive ServiceNow experience.

AD
AD