Skip to main content

Hello - I'm working on Nintex classic form where I need to check if the user has entered a time outside of a certain range. I have 2 fields  Arrival Time and Department Time with Date/Time control (See picture below). 

I would like to create a validation rule that prevents a user selects the arrival time before 7AM or can’t select the department time after 7PM on the form. I used a formula below but it doesn’t work. I would greatly appreciated for your help.

 isNullOrEmpty({Self}) OR greaterThan(dtArrivalMon1),7:00 AM)

 

Arrival Time control below:

 

You can accomplish this by adding a Validation rule to the dtArrivalMon1 control. Here’s how to configure this scenario:

1. Select the dtArrivalMon1 control and click the “Add Rule” button in the ribbon to add a rule to this control.

2. Configure the validation rule.

  • Name = Validate Arrival Time  (or name it whatever you like)
  • Rule Type = Validation
  • Condition = and(not(isNullorEmpty(dtArrivalMon1)),or(greaterThanOrEqual(formatDate(dtArrivalMon1,"HH"),19),lessThanOrEqual(formatDate(dtArrivalMon1,"HH"),6)))
  • Message = Please enter a time between 7 AM and 7 PM   (or whatever you like).

3. This should mark the dtArrivalMon1 field as invalid if a date is selected and a time before 7 am or after 7 pm is selected.

 


Thanks so much for your help. I will try that. Have a good weekend.


Reply