When a person replies using the Lazy Approval method, the body of the email gets stored in the Approver Comments in the Workflow Tasks.
We use this to reference the comments of the approvers during our 16 approvers process.
Is there a way to eliminate the entire body of the email that gets stored into the Approver Comments field??
(the top 2 Lazy Approval reply lines would be sufficient)
Solved! Go to Solution.
When you are using lazy approval a string like this >>> [#HDLSIEIFJSKEID#] is used to identify a task. You cannot eliminate it.
If you want a Approver Comments without that string you can use the replace function and a regular expression to eliminate it.
Take a look at >>> How to strip Approver Comment in Nintex Workflow? | SharePoint Rider
Thanks for your reply. I have used the RegEx Action to extract the content and eliminate the email body content. I now have this nicely scrubbed data variable, but it appears that I cannot update the ApprovalComment field in the Workflow Tasks lists. Is there a way around that?
The approach I have taken in the past is to build up my own Approval Comment variable and populate it into a column as I go with the appropriate data. While it is more work, you have complete control over the format and content of the field and to be truthful, probably arrived at the conclusion that I could not change the inbuilt field. This is probably by design though, as an auditing type requirement.
Thanks for the information. I think I will take that route. Since I have already scrubbed the LazyApproval response data, I can take the field off from the WF Task List and update my own approver comment field.
I am having this same issue with the Lazy Approval Approver Comments. Would you be willing to share the RegEx formula you used? I'm just a novice in RegEx, but I was trying the Negative Lookahead and I couldn't capture what I was intending, which was just the first few lines of the email response.
The actual RegEx is quite simple; I use a Regular expression action, ignoring the case, with a pattern of: ^.*\n.*
I then store the results in a collection, us the Collection operation action to Get the scrubbed comment and update the record.
I only do this in one scenario on my entire farm but have used it for over a year without any issues.
Hope that helps.
I tried your pattern and it is picking up the 1st line. What if I want to grab the first 2 lines, because the 2nd line actually contains the comments, if there were any. Do you know how to grab the top 2 lines? The remaining piece on capturing the data in a variable makes sense.
Just add to the rear of the expression another: \n
Sorry, I'm really swamped with work but try the RegEx site below, I believe it will really help you sample and test expressions:
h t t p : / / r e g e x r . c o m
Thanks Kathy. I used this pattern to Extract the first 2 lines of the Approver Comments. This cleans up the Lazy Approval perfectly! And I don't get all that extra garbage from the email body.
Thanks for your input. I'm much further along than I was yesterday. And the RegExr site is SUPER helpful.