How to strip Approver Comment in Nintex Workflow?

Requirement:

I’m attempting to strip the user, date, lazyapproval, email address and other things from the Approvers Comment.

Solution:

Do you know of an easier way or the values to enter in to the Regular Expression action?  The goal is to return just the comments entered on the approval screen.

Regular expression action 1:

Pattern: ^.*[\S].*[\s]

Mode: Replace text

Replacement text: leave empty

Input text: {Common:LastApproverComments}

Store result in ApproverComments workflow var

Follow by Regular Expression action 2:

Pattern: ^\(.+\)\s

Mode: Replace text

Replacement text: Leave empty

Input text: {WorkflowVariable:ApproverComments}

Store result in ApproverComments workflow var

You can stop here if LazyApproval is disabled. If you are using LazyApproval as well:

Regular Expression action 3:

Pattern: \s*_{7,}

Mode: Split

Input text: {WorkflowVariable:ApproverComments}

Store result in: A collection variable

Finally use a Collection Operation to pull out the first item of the collection.

Advertisements

About Joseph Velliah
As a SharePoint Developer my professional interests tend to be technical and SharePoint focused. I run a blog at "SP RIDER" where you can expect to read HOW TOs and scenarios that I run into during my day to day job. I hope my posts will give back a little to the community that is helped me.

4 Responses to How to strip Approver Comment in Nintex Workflow?

  1. Vijaya Laxmi says:

    Thanks for your post . Even I had the same requirement and I used your regex and updated it.

    Pattern: ^.*[\S].*[\s].*[\)]

    Mode: Replace text

    Replacement text: leave empty

    Input text: {Common:LastApproverComments}

    Store result in ApproverComments workflow var

    • Great Thank you for sharing Viji

    • Nick Hurst says:

      So there is an issue where if the approver puts brackets in their reply, the pattern matches that last closing bracket.

      For example a LastApproverComment of:
      UserName (Approve) 1/13/2017 11:34 AM – 1/13/2017 11:35 AM (UserName) Approving this time but need more advance warning next time (at least 1 week). Thanks.

      Only returns ‘. Thanks.’

      Is it possible to do a pattern where it just grabs everything after the 2nd closing bracket ‘)’ perhaps?

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: