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:

  1. Open the Nintex Workflow designer and add a Regular Expression action.
  2. 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.
  3. 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
  4. The value (987 in the example) is stored in the Text workflow variable and can be used else where within your workflow.

Nintex Workflow Regular Expression - Extract Parameter from URL

Nintex Workflow Collection Operation - Extract Parameter from URL

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: