Skip Ribbon Commands
Skip to main content

Erin Glenn's Blog

:

Erin Glenn's Blog > Posts > Nintex Form Field Validation Expressions
March 30
Nintex Form Field Validation Expressions

I'm just learning Nin​tex Forms and found out that a SharePoint field control, such as a number field set to two decimals, comes over on the Nintex form as a Single Line Textbox control and doesn't respect the SharePoint field settings!  So, the user can type in alpha characters, 500 numbers after the decimal, etc.  Annoying!

So, here are some of my common expressions used in the Validations section of the Control Settings of the Single Line Textbox SharePoint field control:

NintexControlSettings.jpg

Currency

To show currency in ##.## format, 1-199 before the decimal and 2 digits after the decimal.

^([1][1-9][0-9]|[1-9][0-9]|[0-9])((\.)[0-9][0-9])$

Decimal

To show a number in #.## format where the decimal is optional, allowing 1-2 digits before the decimal and 1-2 digits after the decimal (optional).

^[1-9][0-9]{0,2}(?:\.[0-9]{​0,2})?$​

Days of the Month

To allow numbers 1-31 to be entered.

^(3[01]|[12][0-9]|[1-9])$​​

Valid Year

To allow a valid 4-digit year between 1900-2099.

^(?:(?:19|20)[0-9]{2})​​

Valid Zip Code

To allow 00000-99999 to be entered.

^\d{1,5}$

Number Range

To allow numbers 1-160 to be entered.

^([1-9]|[1-8][0-9]|9[0-9]|1[0-5][0-9]|160)$​

(It's easiest to use this Number Range Generator​. Just remember to include the carat (^) at the beginning and the dollar symbol ($) at the end.)

Here's a great reference​ for Regular Expressions that I used to build mine above.
​​​

Comments

There are no comments for this post.