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

How to extract text for username?

Jump to solution


I have a user name with "domain\user11" and need to be extract text after the "\", how can I achieve this using Nintex WF 2010?

 

Thanks!

Labels: (2)
Reply
7 Replies
Highlighted
Automation Master
Automation Master

Re: How to extract text for username?

Jump to solution

Hello,

One way is to use a "Build String" action and then use something like the replace function inside of it:

fn-Replace(text to modify, old text to replace, replacement text)

So in your case something like - note the empty single quotes might be hard to see below as the third parameter passed in:

fn-Replace(variableThatHoldsInformationToModify, 'domain\', '')

Then in the Store Results In area of the Build String put whatever variable you want the results to be stored in, which will hold the value without the domain.

Note:  I'm assuming the domain is always the same, because you didn't specify how this value was being generated..

Thanks

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to extract text for username?

Jump to solution

You can also use the Regular Expression action:

 

 

 

 

  • /^[^\\]+\\(.*)$/

     

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

 

Manfred

View solution in original post

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to extract text for username?

Jump to solution

Thanks Mike M. and Manfred, both suggestions worked.  I went with the Regular Expression since we have two different domain names and formula would work in this situation.

0 Kudos
Reply
Highlighted
Not applicable

Re: How to extract text for username?

Jump to solution

Hi,

If i can ask one more question cous post is close to mine

I got url in collection (http://server.xx/sites/2015/documntslibrary/documentsworkspace/document.docx

Need to cut all before last "/" or before 7th "/" from left (its the same, but different approach). I want to achieve this link: http://server.xx/sites/2015/documntslibrary/documentsworkspace/

In simple inline functions cant find something that can help me to do this.

Regards

Piotr

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to extract text for username?

Jump to solution

Use regular expression action with operation replace text:

/^.*(\/[^\/]+)$/

  • ^ assert position at start of the string
  • .* matches any character (except newline)
    • Quantifier: * Between zero and unlimited times, as many times as possible, giving back as needed [greedy]
  • 1st Capturing group (\/[^\/]+)
    • \/ matches the character / literally
    • [^\/]+ match a single character not present in the list below
      • Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy]
      • \/ matches the character / literally
  • $ assert position at end of the string
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to extract text for username?

Jump to solution

Any parttern to extract only the comments of approver?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: How to extract text for username?

Jump to solution
0 Kudos
Reply