How to create validation for the below mentioned field it should accept only time(8:00AM to 05:00PM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 07:46 PM
Hi,
How to create validation for the below mentioned field it should accept only time(8:00AM to 05:00PM)
I have a Create incident Record producer which consists of field:
Opening and closure time on Monday (sample add 8:00 AM to 16:00 PM) if the same format will not going to enter the user it will show some error message.
Please help me out how it is possible.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 08:00 PM
If this is the only permitted value, why don't you hardcode the value and make the field read only, that will save you the effort of adding validation to the field.
Or you can use regex to validate the field value
You can follow below servicenow blog to achieve the same, just have to generate regex for the time format that you have.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 03:29 AM
Hi @kranthi2
Try this way
and in script section add the alert.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 04:23 PM
Thanks for your response, here in my case i want to put any kind of date validation.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2024 07:38 AM
Hi @kranthi2
You can use Trend operator and choose the validation part here
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************