Regular expression

  • 22 November 2017
  • 4 replies
  • 3 views

Badge +6

Hello everyone. 

I need help with a regular expression that extracts comments only from the LastApproverComments variable. I tried below () but it doesn't trim out the part with outcome, date and time.

210915_pastedImage_1.png

Here's the regular expression I used: .*NotsRequired).*

And the string:

John Doe (Approve) 21/11/2017 2:48 PM - 21/11/2017 2:48 PM
(John Doe) I want only this comment to appear
Michael Jackson (Not Required) 11/2/2015 2:48 PM -
Mike William (Not Required) 21/11/2017 2:48 PM -
Paul Smith (Not Required) 21/11/2017 2:48 PM -


4 replies

Badge +9

Use below steps.

210924_pastedImage_1.png

1. Set Variable.

210927_pastedImage_4.png

2. Regular Expression.

210925_pastedImage_2.png

3. Regular Expression.

210926_pastedImage_3.png

Badge +6

Thanks for your response Lakshmi C‌. Your solution works, but I also want to show the name of the person who commented.

For example, from below comment, 

John Doe (Approve) 21/11/2017 2:48 PM - 21/11/2017 2:48 PM
(John Doe) I want only this comment to appear
Michael Jackson (Not Required) 11/2/2015 2:48 PM - 
Mike William (Not Required) 21/11/2017 2:48 PM - 
Paul Smith (Not Required) 21/11/2017 2:48 PM -

I want to remain with 

(John Doe) I want only this comment to appear

Badge +9

Method 1 - you can use 'Set Variable' action like below.

210950_pastedImage_3.png

You can use 'Last Task Respondent Display Name' or 'Initiator's Display Name' then append with your formatted 'Approve Comments' workflow variable.

Method 2

Step 1:

210936_pastedImage_1.png

Step 2:

210937_pastedImage_2.png

Badge +6

Great! This is exactly what I wanted. Thanks

Reply