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.

4 thoughts on “How to strip Approver Comment in Nintex Workflow?

  1. 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

    Like

    1. 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?

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.