How to Retrieve x Number of Characters From Right Side Of String

  • 18 August 2017
  • 5 replies
  • 102 views

Badge +5

Hi Gang

I've got a document approval workflow that grabs information from the workflow history list.  When it grabs the User information I get a string that I need to pull data from.  Here is an example of a string format that I'm working with that I get as the User.

i:0e.t|getaccess|z0008x5e

I need to programmatically find the last "|" in the string and then grab the substring after that "|" to the end of the string.  So what I programmatically need to pull out given this example would be "z0008x5e".

Can anyone help me with this?  I know there is a SubStr() and InStr() in Nintex but I think I need more to get what I need.

Best Regards,
Andy


5 replies

Userlevel 5
Badge +13

Hi Andy,

Try the following regular expression:  [^|]*$

Badge +5

Hi Eric

Thanks for the response!  I'm not sure how to use this.  Can you give me a full example?

Thanks

Andy

Userlevel 4
Badge +7

Hi Andy McVicker

Add a Regular Expression action into your workflow and configure like this:

This will save your result into a collection variable and you can then extract it using a collection operation described here:

Hope this helps

Badge +5

Thanks Paul.  So is it putting just z0008x5e into the collection variable or is it putting

i:0e.t

getaccess

z0008x5e

into the collection variable?

Best Regards,

Andy

Userlevel 4
Badge +7

Just z0008x5e

Then use the Get operation with an index of 0 and you will have your result

Reply