DATEVALUE
The DATEVALUE function converts a date that is stored as Text into a Date.
Use
DATEVALUE( text )
Create a date from the text value.
| Parameter | Required | Description |
|---|---|---|
| text | Yes | the text that represents a date in local format |
| Returns | Date |
Examples
Validation Against a Fixed Cut-off Date
You can use DATEVALUE within an Output Validation Formula to ensure a user enters a date that falls after a specific deadline or company milestone that you define as a text string.
- Scenario: A user must enter a "Start Date" for a project, and it must be after the company’s new fiscal year launch on April 6, 2024.
- Formula:
this > DATEVALUE("06/04/2024") - Logic: The function converts the text "06/04/2024" into a Date object. The validation formula then compares the current input (
this) to that object, returning TRUE only if the entered date is later.
Initializing a Variable from a Text String
When setting up an approval, you may want a Variable to start with a specific date. If that date is provided as a string (perhaps from an external source or a legacy text field), you must use DATEVALUE to ensure the variable holds the correct data type.
- Scenario: You need to initialize a variable named
$ContractExpiryto a fixed date. - Formula:
DATEVALUE("31/12/2025") - Logic: Applying this in the Variable Initialization section of the Start step ensures that
$ContractExpiryis treated as a Date rather than a string of characters. This allows you to use that variable in later steps for calculations, such as determining the number of days remaining using theDAYSfunction.