For the managed package runtime, 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.
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
- Drag a Date element from the Build panel onto the canvas.
- In the Properties panel, give the element a name in the Name field.
- In Field Label, enter a label visible to the user.
-
In Minimum Date, 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 in the Date Format field. For example, to set the minimum date to January 1, 1950, if the Date Format is MM-DD-YYYY, you must enter 01-01-1950.
The Minimum Date field doesn't accept merge fields.
-
In Maximum Date, 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 in the Date Format field. For example, to set the maximum date to December 31, 2019, if the Date Format is MM-DD-YYYY, you must enter 12-31-2019.
The Maximum Date field doesn't accept merge fields.
- In Date Format, 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.
-
(Optional) 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 Model Date 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.
Note Using this format instead of a String such asYYYY-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.
-
-
Model Date Format: Specifies how the date is formatted in the Data JSON when Data Type is set to String. For example, YYYY-MM-DD. For more format options, see Day.js.
NoteThe 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.
-
-
(Optional) Enter a Default Value. See Set a Default Value for an Element (Managed Package).
Note
The format entered must be the same as in the Date Format field. For example, to set the minimum date to January 1, 1950, if the Date 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.
- (Optional) For additional properties, see Common Omniscript Element Properties Definitions (Managed Package).
- Date Properties (Managed Package)
For the managed package runtime, Date properties are configurable from the Properties panel when you select a Date element. With the Date element, enable users to select a date from a date picker in your Omniscript.