cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

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

Jump to solution

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

Labels: (1)
0 Kudos
Reply
5 Replies
Workflow Hero

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

Jump to solution

Hi Andy,

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

Reply
Workflow Hero

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

Jump to solution

Hi Eric

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

Thanks

Andy

0 Kudos
Reply
Workflow Hero

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

Jump to solution

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

Reply
Workflow Hero

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

Jump to solution

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

0 Kudos
Reply
Workflow Hero

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

Jump to solution

Just z0008x5e

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

0 Kudos
Reply