Skip to main content
Nintex Community Menu Bar

Build String Action - username from full name

  • February 25, 2016
  • 3 replies
  • 21 views

Forum|alt.badge.img+9

Hello - I am trying to build a string that converts Full Name to Username. For example I have John Smith in a field and would like to extract jSmith. What should be the correct syntax?

3 replies

Forum|alt.badge.img+7
  • February 26, 2016

Hi,

If you use a combination of a Regular expression to split based on space character and then fn-Substring('your text',1,1) to get the first character in a Build string action you should be fine.

Jan


Forum|alt.badge.img+9
  • February 26, 2016

Use Regular expression action:

^(.)[^ ]* (w+)$

  • ^ assert position at start of the string
  • 1st Capturing group (.)
    • . matches any character (except newline)
  • [^ ]* match a single character not present in the list below
    • Quantifier: * Between zero and unlimited times, as many times as possible, giving back as needed [greedy]
    • the literal character
  • matches the character literally
  • 2nd Capturing group (w+)
    • w+ match any word character [a-zA-Z0-9_]
      • Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy]
  • $ assert position at end of the string

Forum|alt.badge.img+9
  • Author
  • Scholar
  • February 26, 2016

Works flawlessly!!! Thanks!