A Date and Time question is one of the question types that can be added to a Form action. This article discusses Date and Time questions in more detail.
NOTE: Familiarity with Form actions is recommended to better understand this article. For more information, see Form Action.
Table of Contents
What is a Date and Time Question?
When used in a Form action, a Date and Time question displays a Date and Time picker where users can select the date and time.
The Date and Time question is ideal for workflows involving duration, or the period between two dates and times. For example, an airline flight's expected date and time of departure and expected date and time of arrival, will help compute for the flight duration, or the time it will take the airliner to get from one point to another. In this case, you need to add a Date and Time question for the flight's expected date and time of departure, and another Date and Time question for the flight's expected date and time of arrival.
You will need to save the answers to both questions in square brackets. In turn, the square brackets can be used as inputs to a Date Calculator Action for computing the duration of the flight.
To display the results of the Date Calculator action, you need to add a Page Action to your workflow. In case you want the results to be emailed, you may add an Email Action instead.
An image of the default Date and Time control that comes with a Date and Time question is seen below.
In case the default Date and Time control does not suit your needs, setting the Date and Time question's Advanced Options will allow you to customize a date and time control that will fit your workflow.
Setting Up a Date and Time Question
To add a Date and Time question to a Form action, select it from the list on the Action Editor. You can then start setting up the Date and Time question. For more information, see Setting Up a Form Action.
Advanced Options
Under a Date and Time question's Advanced options section, you can set up the following:
- Default value: The default Date and Time that will be displayed on the Calendar.
-
- This is set to Select from [square_brackets] by default, even if you have not defined a square bracket previously, in which case a message saying that there are no available square brackets is displayed immediately below.
- To use an available square bracket for the default value, enter the square bracket name on the box below.
- You can also set this Select input, in which case you can select either Current Date and Time (the date and time when a user is filling in the form) or a custom date and time.
-
- Input date format: The format of the date, as displayed on the User Application. The default date format is YYYY-MM-DD. A wide variety of input date formats is available for selection from the list.
- Input time format: The format of the time, as displayed on the User Application. You can only set an input time format if you have set an input date format. The default time format is 24 hour clock HH:MM. You will need to set hour first (HH) before you can set the minute (MM).
- Limit Date Range: The dates that will be displayed for selection. This is set to None by default. You can customize this depending on your requirements.
- Button name (optional): Form actions are set to be non-scrollable by default, meaning you have to click a button at the bottom of each Question page to go to the next question. The button name is set to Continue by default. You can set a new name for the button here.
- Conditional Questions: Each question type you can use in a Form action can be set to include Conditional Questions, if required. With Conditional questions, a question can be made to appear or disappear, depending on certain conditions. For more information, see Conditional Questions.
Sample Usage
Set the Advanced Options for a Date and Time question using the image below as a guide.
When run within a workflow on the User Application, the above settings will result in the Date section of the control as shown below, assuming that current date is 2021-07-25. Note that the dates prior to the current date are disabled to prevent their selection.
The default Time section of the control is shown below. You can set the hour and minute by clicking the Up or Down arrows on the Time control.
Comments
0 comments
Article is closed for comments.