cancel
Showing results for 
Search instead for 
Did you mean: 
SteveJonasson
Nintex Newbie

Pick some letters from string to fill field username (SHP 2013 workflow)

Hi guys,

 

I'm stucked at kind of tricky thing. I have a field in the form (person or group). If someone fill the field with a person from AD, my workflow does convert it to a plain text. Then I get "Steve Jonasson" from it, for example. Then, I have another field (one line of text(empty - filled with workflow afterwards)) and I need to put above mention name to this field, but adjusted like this:

5 first letters from Surname.

3 first letter from Name.

= JonasSte

How can I do it via Nintex workflow? Can you redirect me to some tutorial with pictures (at the best) or video tutorial? Should I use regular expression? Some function? Anything can help me.

 

Thank You

 

Steve

Labels: (1)
0 Kudos
Reply
6 Replies
mlauer
Nintex Newbie

Re: Pick some letters from string to fill field username (SHP 2013 workflow)

use regular expression action and store result in a single line text variable:

grafik.png

here is the pattern as text:

^([A-Z][a-zA-Z]{1,2})[a-z]* ([A-Z][a-zA-Z]{1,4}).*$

 

and the explanation:

grafik.png

grafik.png

 

 

Reply
SteveJonasson
Nintex Newbie

Re: Pick some letters from string to fill field username (SHP 2013 workflow)

Thank you very much for your response and viable screens and manual.

Probably, I'll have to study about the scheme you sent me. I hope I will solve the problem out with variables.

Edit: It does not work for me right now.

Edit 2: I already got it (I mean the system how it works). But it needs some precise work. Thank you for your pattern mlauer, but now what? I've pasted the pattern in "Pattern zone" and it still does not work. It shoud all be set correctly. Do not I need to put some "fn-replace" or something in front of the pattern? I also used Nintex tutorials to find awesome "RegExr" editor. It helped me a lot.

Edit 3: Your solution is working, but only when I use specified text, in our case, "Steve Jonasson". But I need to put into the field, where Steve Jonasson is, variable.

 

Check the attachement to see more. I'm going to try to solve it out by myself with variables, but every piece of advice may help me Smiley Happy

 

Thanks.

 

Steve

 

0 Kudos
Reply
mlauer
Nintex Newbie

Re: Pick some letters from string to fill field username (SHP 2013 workflow)

Your screenshot looks good. Please note that for a test with "Run now" no variables can be used, because they are only available when starting the workflow.

0 Kudos
Reply
SteveJonasson
Nintex Newbie

Re: Pick some letters from string to fill field username (SHP 2013 workflow)

I know, I know. It would be perfectly working without having "accents and diacritics" in my name, colleagues name etc… The variable takes name, for example, Štěpán Petržel and put it to regular expression and it does not work. I need something to replace diacritics in names - Czech and Slovak.
Is there a pattern to use for it? Or not?
Thank you very much and sorry for late response.
0 Kudos
Reply
mlauer
Nintex Newbie

Re: Pick some letters from string to fill field username (SHP 2013 workflow)

You can extend the character classes enclosed in [] by unicode characters, e.g.

[\x{00C4}-\x{00C9}] matches range between Ä (index 196) and É (index 201)

see also List of Unicode characters

0 Kudos
Reply
SteveJonasson
Nintex Newbie

Re: Pick some letters from string to fill field username (SHP 2013 workflow)

We do not understand each other.

Our language has accented letters/characters = ěščřžýáíéúůŠČŘŽÝÁÍÉÚŮ

The pattern doesn't accept it. I'm trying to reach the state when "Sežer Hřbet" will be put in collection like: "Sezer Hrbet" with no accent. At the final state, with your pattern, stored in collection "HrbetSez", it would be great.

 

Does anything like this exist? Can I do it with regex (regular expression)?

0 Kudos
Reply