cancel
Showing results for 
Search instead for 
Did you mean: 
lpetre
Nintex Newbie

Date/Time Validation - Request Off Form

Jump to solution

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. 

0 Kudos
Reply
4 Replies
Automation Master
Automation Master

Re: Date/Time Validation - Request Off Form

Jump to solution

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

View solution in original post

0 Kudos
Reply
lpetre
Nintex Newbie

Re: Date/Time Validation - Request Off Form

Jump to solution

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? 

0 Kudos
Reply
Automation Master
Automation Master

Re: Date/Time Validation - Request Off Form

Jump to solution

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.

Reply
Nintex Employee
Nintex Employee

Re: Date/Time Validation - Request Off Form

Jump to solution

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.

Cheers,

Euan

Reply