top of page
Search

Fun with Validation Rules: Minimize Date Errors



Hey folks, Dave Parrish here with Knack Builders!


Today, I want to kick off a new series I’m calling “Fun with Validation Rules”. We’re going to look at real-world use cases for validation rules in Knack, and I’ll be sharing quick lessons that can save you a ton of time (and headaches). This first one is all about minimizing errors with date fields.


The Problem: Dates Defaulting to the Current Year

Last week, I had an interesting support case with one of my clients, Tri-State Honor Flights. If you’re not familiar, they organize trips several times a year to fly veterans to Washington, D.C. to visit war memorials. It’s a powerful, meaningful experience—and naturally, the application process for veterans is very important.


One of the key criteria for eligibility? Age.


Now here’s the issue: applicants (many of them elderly) were entering their birthdays incorrectly. Specifically, they were inputting just the month and day, leaving out the year. And guess what Knack does when you do that?

It defaults to the current year—2025 in this case.


So suddenly, we had a bunch of 90-year-old veterans showing up in our system as zero years old. Not helpful.


Why This Matters: Age Affects Selection

Selection for these trips is based primarily on age and whether the applicant is healthy enough to travel. If a birthday gets entered incorrectly and a vet appears much younger than they are—or vice versa—it could mean they don’t get selected at all.

We needed to fix this, and fast.


The Solution: A Simple Validation Rule

Here’s where Knack’s validation rules saved the day. I added a rule directly to the date of birth field.

The logic? Simple:

If the date of birth falls in the current year, throw an error.

Here’s the message we used:

"Check your date of birth. Something doesn’t look right."

That alone has already reduced the number of incorrect entries considerably.

Let me show you an example. If someone tries to enter just “March 22” (without a year), Knack will auto-fill 2025. But thanks to our validation rule, they’ll now get an error message instead of unknowingly submitting the wrong info.


Bonus Step: Adding a Confirmation Page

I didn’t stop there. This part isn’t technically a validation rule, but it’s just as useful.

After submitting the application, users are now redirected to a confirmation page (instead of just getting a “Thanks, we received it!” message). On this new page, we ask them to double-check two critical fields:


  • Date of birth

  • Email address


This adds an extra layer of review. Sure, some people might breeze past it, but others will catch and fix mistakes. And once they confirm, they get the usual confirmation message.


Final Thoughts

That’s it for today’s tip! This small adjustment—one validation rule and one confirmation step—has already made a big difference in the accuracy of submitted applications.

I’ll be sharing more of these bite-sized tricks in the coming weeks, so stay tuned for more “Fun with Validation Rules.”

Thanks for reading,


Interested in my Knack database services? ... Book a call with me here: https://calendly.com/daveparrish/callwithdave 




 
 
 

Comments


bottom of page