You are here:
Omniscripts Date Element
Enable users to select a date from a date picker by adding a Date element to your Omniscript. Set the minimum and maximum dates and the date format.
-
Enter the earliest date the user can select from the date picker, such as
01-01-1950.
You can pick a fixed date, or you can enter a relative date in the format
TODAY +/- N day(s)/week(s)/month(s)/year(s). For example, you can enterTODAY — 1 dayorTODAY + 3 months.NoteThe format entered must be the same as specified in the date display format. For example, to set the minimum date to January 1, 1950, if the date format is MM-DD-YYYY, enter 01-01-1950.
The Minimum Date field doesn't accept merge fields.
-
Enter the latest date the user can select from the date picker, such as
12-31-2019.
You can pick a fixed date, or you can enter a relative date in the format
TODAY +/- N day(s)/week(s)/month(s)/year(s). For example, you can enterTODAY — 1 dayorTODAY + 3 months.NoteThe format entered must be the same as specified in the date display format. For example, to set the minimum date to January 1, 1950, if the date format is MM-DD-YYYY, enter 01-01-1950.
The Maximum Date field doesn't accept merge fields.
-
Enter the format to display the date.
For example, if the format is MM-DD-YYYY, and the user selects January 3, 2020 from the date picker, the date displays as 01-03-2020. For more format options, see Day.js.
-
In the Advanced Options section, update values for the following properties:
- Data Type: Specifies how to display the date in the Data JSON.
If set to String, the specified format is applied. String is the default data type.
If set to Date, the date is encoded as an ISO 8601 datetime, such as 2018-01-28T05:00:00.000Z, in the GMT/UTC time zone.
Using this format instead of a String such as
YYYY-MM-DDwithout a time requires a thorough understanding of time zone handling. Midnight of the date is converted from either the org time zone or the user's time zone to GMT/UTC. - Format: Specifies how the date is formatted in the
Data JSON when Data Type is set to
String. For example, YYYY-MM-DD.
In the designer for a managed package, specify the format in the Model
Date Format field. For more format options, see Day.js.
The Date element's Model Date Format must match the Omnistudio Data Mapper's date format. Mismatched date formats can result in a blank Date element.
- Data Type: Specifies how to display the date in the Data JSON.
-
Enter a Default Value. See Set a Default Value for an Omniscript Element.
Note
The format entered must be the same as in the specified in the date display format. field. For example, to set the minimum date to January 1, 1950, if the date display format is MM-DD-YYYY, you must enter 01-01-1950.
The date picker lets the user choose a date that is +/- 100 years from the default date.

