Regular Expression to Extract the First Part of a URL in Nintex Workflow
Using the Regular Expression action in Nintex Workflow, you can extract the first part of a URL and store it in a workflow variable to use in the rest of the workflow.
Follow these steps to build out this functionality:
- Add a Regular Expression action to the workflow.
- Configure the action with the following options:
- Pattern = See examples in the table below
- Ignore case = Check if string case should be ignored
- Operation = Extract
- Input text = URL string to extract data from (can be hard coded or inserted from the Insert Reference button)
- Store result in = Create a “Single line of text” variable to use.
- Note: The result is stored in a Collection variable. You will need to add another action like the “Collection Operation” action to get the result.
- Use the “Run Now” functionality to test the regular expression.
Examples
Below are the results when using each of the Patterns with this example URL in the “Input text” field:
https://DomainName.com/sites/SiteName/SubsiteName/ListName.aspx
Pattern | Result |
(^https:\/\/[\w\d].[\w\d]*) | https://DomainName.com |
(^https:\/\/[\w\d].[\w\d]\/[\w\d]*) | https://DomainName.com/sites |
(^https:\/\/[\w\d].[\w\d]\/sites\/[\w\d]*) | https://DomainName.com/sites/SiteName |
(^https:\/\/[\w\d].[\w\d]\/[\w\d]\/SiteName\/[\w\d]) | https://DomainName.com/sites/SiteName/SubsiteName |

Show and Hide Group Controls Using a Choice – Multiple Field in a Nintex Workflow Cloud (NWC) Form
In this video, I show you how to show and hide Group controls using a Choice – Multiple control in a Nintex Workflow Cloud (NWC) form. As part of this solution, I will also show you how to configure Form Rules to accomplish this dynamic functionality.
Show and Hide a Group Control Using a Checkbox in a Nintex Workflow Cloud (NWC) Form
In this video, I walk you through you how to show and hide a Group control using a Checkbox control in a Nintex Workflow Cloud (NWC) form. As part of this solution, I will also show you how to configure a Form Rule to accomplish this dynamic functionality.
How To Restrict Numeric Data Entered to a Certain Number of Digits in a Nintex Workflow Cloud Form (NWC)
You can easily configure a form field to only accept a certain number of digits as input. This configuration also will not allow text or special characters to be entered in the form field. This post will show you how configure this in a Nintex Workflow Cloud form. This solution can be useful to validate data like Account Numbers, Employee IDs, Invoice Numbers, and many other examples.
Follow these steps to build out this functionality:
- Add a Text – Short control to the form.
- Select “Regular expression” in the Input Validation setting drop-down menu.
- Enter the desired regular expression string in the Pattern field. Below are examples:
Restrict Number of Digits Entered to: | Pattern: |
5 digit number | ^(\d{5})$ |
7 or 8 digit number | ^(\d{7}|\d{8})$ |
9, 10, or 12 digit number | ^(\d{9}|\d{10}|\d{12})$ |
- Feel free to enter a message in the “Custom Regular expression message” field.
- This message displays if the data entered is not the correct number of digits.
- You can use this message as an instruction to the form user to correct the data.
- Test out this functionality by going to the Preview tab and adding data to the form field you configured.
- If you enter fewer or more digits than the pattern, the field is marked as invalid and the “Custom Regular expression message” appears under the field.
- If you enter text or special characters, the field will also be marked as invalid and the “Custom Regular expression message” appears under the field.

Set Up Age Verification on a Date/Time Control in a Nintex Workflow Cloud Form (NWC)
In this scenario, we need to verify that a user is older than a certain age (i.e. 18 or 21) based upon a date of birth entered in a Date/Time form field. This can be accomplished by creating a Submit Rule to validate the date field.
Follow these steps to build out this functionality:
- Add and configure a Date/Time control on the form:
- Enter a name like “Date of Birth”.
- Make sure the “Restrict past dates” toggle is set to No.
- You can also add a Description or Tooltip with a message like “You must be over 18 years old”.
- Configure a Submit Rule on the form:
- Go to the Rules tab.
- Click on the “Add submit rule” button in the Submit Rules section.
- Enter a descriptive Name for the rule like “Verify Date of Birth Over 18”.
- Configure the If statement.
- Click on the blue Insert button on the first drop-down field.
- Configure the Formula field.
- Find and insert the dateDiff() function from the Functions tab of the Lookup section.
- Enter “TotalYears” as the first parameter (make sure to include the quotation marks).
- Find and insert the “Date of Birth” form control as the second parameter.
- Find and insert the dateNow() function as the third parameter.
- The Formula should now be configured as (see the image below):
dateDiff(“TotalYears”,[Form].[Date of Birth],dateNow()) - Click the Insert button to save the Submit Rules.
- Select “Less than” from the second drop down field.
- Enter the age (18 or 21) that the user needs to be older than.
- Configure the Then statement.
- Select “Date of Birth” from the first drop-down field.
- Select “Show Validation Error” from the second drop-down field.
- Enter a message like “You must be older than 18 years old” in the third field.
- The Submit Rule should now look like the image below:
- Click the “Create rule” button to save and activate the Submit Rule.
- Test out your rule by going to the Preview tab, selecting a Date of Birth, and clicking the Submit button.
- If the user is under 18, the field will be marked as invalid and the validation message will appear.
- When the user is over 18, then the field is valid and the form can be submitted.
You can find out more about the Nintex Workflow Cloud functionality used in this blog:
Date/Time form control: https://help.nintex.com/en-US/nwc/Content/Designer/FormControls/DateTime.htm
Rules: https://help.nintex.com/en-US/nwc/Content/Designer/FormsRules.htm
Validate a Single Email Address Field in a Nintex Form
I recently built a Nintex Form that included a field where the user was asked to fill in their email address. The form needed to verify that the user was entering a valid email address.
This can be accomplished using a Regular Expression in the settings of the form control. Below are the steps and Regular Expressions I used for validation the email address entered.
- Add a Single Line Textbox control to the form.
- Open the Control Settings and expand the Validation section.
- Change the “Use a regular expression” choice to Yes.
- Enter the one of the regular expressions below in the “Regular expression” field.
- Enter your custom validation message in the “Regular expression error message” field (for example, “Please enter a valid email address”).
- Save and publish the form.
Below is the main regular expression I have used to validate an email address on a form.
(?:[A-Za-z0-9!#$%&’*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&’*+/=?^_`{|}~-]+)*|”(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*”)@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
I have also used the regular expression below to validate an email address. It’s much simpler but does not check as extensively for certain patterns. It does check for a 2-4 domain extension after the period.
^([\w+-.%]+@[\w-.]+\.[A-Za-z]{2,4};?)+$

Kudos to Eric Harris for first sharing this in his post on the Nintex Xchange site: Simple email validation for forms
Get a Parameter within a URL Using a Regular Expression in Nintex Workflow
Recently had a need to extract a parameter from within a URL string using Nintex Workflow. Specifically, I needed to get the ID parameter from a URL. In the example URL below, I needed to extract the number 987:
//mysite/mypage.aspx?ID=987&User=654
Follow these steps to get the ID number:
- Open the Nintex Workflow designer and add a Regular Expression action.
- Configure the Regular Expression action with the following settings:
- Pattern = (?<=ID=)[^&]+
- Operation = Extract
- Input Text = String, Inserted Reference or Workflow Variable
- Store Result In = Collection workflow variable
- Note: Your can use the “Run Now” option in the ribbon to test out the action.
- Next add a Collection Operation Action with the following settings:
- Target Collection = Collection workflow variable
- Operation = Get
- Index = Integer workflow variable (with “Default value” = 0)
- Store Result In = Text workflow variable
- The value (987 in the example) is stored in the Text workflow variable and can be used else where within your workflow.
Remove Line Breaks in Text Using a Regular Expression in Nintex Workflow
You can remove line breaks in a text string using the Regular Expression action in Nintex Workflow.
Here are the steps to follow:
- Insert a Regular Expression action into your Nintex Workflow.
- Configure it with the following settings:
- Pattern = [\r\n]
- Replacement text = Keep this empty (or use a replacement character)
- Input text = Insert your text string (you can insert a reference to data in a list column or workflow variable)
- Store result in = Text workflow variable
- You can then use the workflow variable as you need it.
Nintex Workflow Stalling on Document Generation Action
I encountered an issue recently where a few Nintex Workflow 2013 workflows that had been running successfully for some time suddenly started stalling. The workflows still showed a status of “In Progress” but were not moving forward. Checking the Workflow Progress and Workflow Details pages showed no error messages or issues. I finally noticed that these workflows were freezing when trying to execute a Document Generation workflow action.
After investigating, I determined that the issue was related to a Nintex Workflow service not running in my SharePoint 2013 environment. Specifically, the Nintex Workflow Start Service was not actively running on any of my SharePoint 2013 servers. Once I restarted that service on one of my servers, the stalled workflows continued running, completed the Document Generation action, and progressed to the next workflow steps.
Get Digits Before a Decimal Point Using a Regular Expression in Nintex Workflow
Using the Regular Expression action in Nintex Workflow, you can get the digits before a decimal point.
Here are the steps to follow:
- Insert a Regular Expression action into your Nintex Workflow.
- Configure it with the following settings:
- String = Your number from a column or workflow variable.
- String Operation = Replace
- Pattern = \.[0-9]+
- Replacement String = Keep this empty
- Output = Text workflow vatiable
- You can then use the workflow variable as you need it.
Here are some examples from using this Regular Expression:
String | Regular Expresssion | Result |
6.5 | \.[0-9]+ | 6 |
1234.5678 | \.[0-9]+ | 1234 |
1234567.89 | \.[0-9]+ | 1234567 |