Skip to main content
Nintex Community Menu Bar

Date/Time Validation - Request Off Form

  • December 31, 2018
  • 4 replies
  • 28 views

Forum|alt.badge.img+1

Using Nintex Forms 2016 in conjunction with SharePoint Server 2016. I am creating a "Request Off Form." The form contains 6 date controls:

Created, Current Date, Current TimeToday's Date, Request Start Date, and Request End Date

Created = Common Property

Current Date = Common Property

Current Time = Common Property

Today's Date = List column, Calculated Value (1st pic)

Request Start Date = List column, Date/Time selector (2nd pic is the Rule)

Request End Date = List column, Date/Time selector (3rd pic is the Rule)

Today's Date

Request Start Date

Request End Date

I want to use Rules to invalidate input: Request Start Date must be greater than or equal to Today's Date. Request End Date must be greater than Request Start Date. My validation works with respect to the dates, but does not work with respect to the times. For instance:

If Today's Date = 01/14/2019 10:00 AM, then Request Start Date = 01/14/2019 09:00 AM should be invalid.

If Request Start Date = 01/15/2019 10:00 AM, then Request End Date = 01/15/2019 08:00 AM should be invalid. 

I have also attempted to convert both compared dates to the Sortable Date/Time:

lessThan(formatDate({Self},"s"), formatDate(Current Date,"s"))

This did not help...

Can anyone in Nintex-Land assist? 

Thank you very much for your time. 

4 replies

Forum|alt.badge.img+14
  • Scholar
  • January 2, 2019

CurrentDate reference always evaluates to date up to midnight. 

so this formula 

If Today's Date = 01/14/2019 10:00 AM, then Request Start Date = 01/14/2019 09:00 AM should be invalid.

cannot consider time

second formula

If Request Start Date = 01/15/2019 10:00 AM, then Request End Date = 01/15/2019 08:00 AM should be invalid. 

should work.

but note that change of hours or minutes doesn't trigger validation formula to be reevaluated. it only reevaluates if you change date part or submit form


Forum|alt.badge.img+1
  • Author
  • January 2, 2019

Thank you for your response. 

      "note that change of hours or minutes doesn't trigger validation formula to be reevaluated. it only reevaluates if you       change date part or submit form"

Are there any methods to have the hours and minutes to trigger the validation formula? 


Forum|alt.badge.img+14
  • Scholar
  • January 2, 2019

not at all on responsive forms.

but is that really necessary?

validation formula is triggered on submit. so if dates are not valid on submit you'll not be able to save the item.

I know, user experience is not pleasant if they see validation error on the form despite inputs are correct. but that's unfortunately how it's work.

Euan Gamble‌, what's your opinion on that? should hour/minute change trigger validation formula to recalculate?

... especially to clear validation error once inputs are corrected.


EuanGamble
Nintex Employee
Forum|alt.badge.img+13
  • Nintex Employee
  • January 6, 2019

Hi Marian Hatala

With Universal Forms, we validate the date and time together if you have chosen to show the Time component. This will validate on submit.

In our current iteration of Universal Forms, the only missing component is the ability to select a control or variable to compare against in the rule builder which we have planned.

221861_pastedImage_1.png

Cheers,

Euan