How to create a pattern in Regular Expression action


Badge +7

Hi Everyone,

I've been having a problem in creating a pattern to remove, replace or capitalized a specific part of a word in a workflow.

All this time I'll just copy all the patterns of others in this forums to integrate on my workflows. But I think it's time to know how to do it. Also I'm really new to this environment so I'm really a beginner in this topic. I have this as an example

i:0#.f|membership|rogelio.tan@company.com

my desired output is:

Rogelio Tan

Thanks in advance

Cheers!


6 replies

Badge +8

Hi Rogelio Tan‌,

Is this really wat you want? I have never met one company where for ALL employees the e-mail address contains the correct name. It sound more that you want the display name from employees based on the account name.

The following webtool will be useful for you when finding the right regular expression: RegExr: Learn, Build, & Test RegEx 

Cheers,

Rick

Userlevel 5
Badge +13

Hi Rogelio, when you add a "people picker" type of field to something, the default is the "Login Name." You can change that to "Display Name" or Email Address. There's a little orange circle with fx in it that you click to pick

202994_pastedImage_1.png

This is available for other column types too. From there, you can pick which format you want the information in:

202995_pastedImage_2.png

Badge +8

In case someone was thinking, where can I do that? was talking about the 'Set (Workflow) Variable' action in Nintex Workflow.

Userlevel 5
Badge +13

I thought you could do it anywhere you have the option to use a value? Ex putting it in the body of an email, setting a value to a variable, etc

Userlevel 5
Badge +14

you will have to learn it on your own, there isn't anything like builder.

search the internet, there are plenty of good references.

nintex uses .net regex parser, its reference you can find here .NET Framework Regular Expressions 

good guidance can provide as well some tester/parser tools, I'd recommend Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript  which provides as well explanation what single tokens within pattern do.

Badge +7

Hi Everyone,

Thanks for all the response. I followed what ‌ showed and seeing that it displays the "Display name" of the user. Also using patterns to display names to fix some minor changes is a lot easier.

Reply