Validate a date field AND check that it falls within a certain range?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2015 11:18 AM
This forum has been incredibly helpful to me, so here I am again, with another question. 🙂
I'm trying to test whether a user-entered date in a record producer falls within a specific range. Here is the code I have in the "What it will contain" scripting section of the record producer (ignore the UtilityBill section):
This code works great if the user enters a date. But if the user puts in random characters or random numbers, the code thinks it falls within the range as well.
Any thoughts on ways I can make sure the user-entered date is a true date AND falls within my range?
Thanks for any help in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2015 11:29 AM
Hi Scott,
You can validate the date with the help of catalog client script. Please refer the below thread for reference.
https://community.servicenow.com/thread/165393

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2015 11:34 AM
Hey Scott,
Why not use variable type 'Date' so the user is forced to select a properly formatted date? This way you are not having to mess w/ random characters and such