logo

NJP

No Code date validations through (Catalog) UI Policies

Import · Aug 06, 2019 · article

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

Hi there,

Client Side date validations, o man, they can be a real pain in the but! Getting the right format, different language settings, timezones, etc.. And then working with Scoped Apps… some GlideDate functions not being available. If you look at the community posts, a lot of situations like these are posted. Scripting not working, applying GlideAjax, splitting dates, etc.. So to share some gained knowledge and experience:

There's a much easier way!

Using the No Code condition builder on (Catalog) UI Policies! Only Low Code needed for an info/error message to display to the user, maybe clearing the field/variable value, etc..

Examples

How to setup checking if…

An entered date for a Variable is in the past. If so, clear the variable value and give the User an error message.

image

image

image

An entered date for a Field is after 7 days in the future. If so, clear the field value and give the User a field message.

image

image

image

Comparing two entered dates with each other. Date 2 should not be before Date 1 (image, planned end date should not be before planned start date)

image

As you can see in the examples above, Low Code for the follow-up on your validation and the actual validating simply through the condition builder within a (Catalog) UI Policy.

---

And that's it actually. Not much to it. Hope you like it. If any questions or remarks, let me know!

Kind regards,

Mark Roethof

ServiceNow Technical Consultant @ Paphos Group---

LinkedIn

Labels:

image

View original source

https://www.servicenow.com/community/developer-articles/no-code-date-validations-through-catalog-ui-policies/ta-p/2297600