Regular Expression can work with {Common:} Token, but not with {WorkflowVariable:)

  • 8 April 2020
  • 2 replies
  • 18 views

Badge +1

I tried to use the Regular Expression Action and define a Pattern.

If I want to use a "Common" Variable inside the Pattern Field, it is replaced with the actual value, before the Pattern is executed.

({Common:WebUrl})(?!.*1)

 

Is transfered to 

(http://MyURl/site)(?!.*1)

and then executed.

 

But When I try to use a WorkflowVariable instead:

({WorkflowVariable:MyVariable}})(?!.*1)

 

It is not replaced and the Pattern is used with the {WorfklowVariable....} part.

 

Do I need to escape the {WorkflowVariable} further, or is this just not supported, and only the {Common} Tag can be replaced ?


2 replies

Userlevel 6
Badge +22
Hi,

I did a quick test in the latest build of Nintex Workflow 2013 and found that I could use either a workflow variable or common reference and both worked as expected.
I didnt use a URL as it was a simple test but it worked either way.
Badge +1

Ok, I found the root cause.

 

As there was a condition in which the variable would not be set to a value, it could be empty.

The interesting part was, even with the variable not initialised I didn't get an exception, when Nintex tried to insert the Variable. It just used the {WorkflowVariable:MyVariable} syntax instead, and put that into the Regular Expression action.

 

So yes, the Action can take both kinds of Tokens, if there are values inside it :)

Reply