How do I set validations on date pickers in VFlow2?

There are two date pickers:
The first date picker starts from the current date.
Any date selected from the first date picker will become the starting date for the second date picker.
The second date picker allows selection up to 90 days from the selected start date.

2 Likes

Hello @Yash_Agarwal,

Setting Validations on Date Pickers in VFlow2

Create a Copy Task

  • Create a Copy Task to copy the current date to a specified path.
  • The copied date should be formatted as shown in the image below:

Set the Start Date Dynamically

  • Pass the copied date path to the Start Date property of the Date Picker by selecting the Dynamic Type option.
  • Refer to the image below for guidance:

Create Another Task Group

  • Create a Task Group containing a Copy Data Task that will set the date using the SETDATE() function.
  • Use the following syntax:
  • SETDATE(getVal(‘tempObject.PATH.startDate’), ‘add’, ‘30 days’)
  • The calculated date (in this case, 30 days from the start date) should be copied to getVal("tempObject.New_date").
  • Reload the second date picker.

Apply the Task on Input Event of the First Date Picker

  • Assign this task to the On Input event of the first date picker so that when a user selects a date, the second date picker updates accordingly.

Set the Date Range for the Second Date Picker

  • Pass the selected date from the first date picker as the start date for the second date picker.
  • Use getVal("tempObject.New_date") as the end date for the second date picker.

First date picker:

Second date picker:


10 Likes