I have a question, how to extract only name and comment from LastApproversComments field... Example of approver comments field is:
Name1 Surename1 (Not Required) 8.1.2018. 15:44 - Križnjak Matej (Approve) 8.1.2018. 15:44 - 8.1.2018. 15:46 (Križnjak Matej) I approve this item Name2 Surename2 (Not Required) 8.1.2018. 15:44 - Name3 Surename3 (Not Required) 8.1.2018. 15:44 -
I want to extract only approver name and his comment like in Description (see picture attached)
Solved! Go to Solution.
the most reliable way is to save task IDs within the task action.
once the task is responded you get a collection of task IDs which you can query from task list for comments or possibly for other related info.
you may find on the forum that some tries to parse the text returned by LastApproverComments variable with regular expressions
I personally don't see it reliable. at first you need to build quite complex regex pattern, and at second you never can avoid that an user posts a comment that will match some of (sub)patterns you try to rulle out.
I agree with Marian,
The Name and Surname should be easy. Look under the common tab and the Last Respondents Display name will give you this detail at Assign Flexi task level, so you will have to write it away.
For the comments, you can probably edit the approval screen and add a custom Comments (Multiple Line Text) fields that will allow you better control in handling the comments and you can use it with the Last Respondent display name field to populate the list as shown in the attachment.
Let me know if this is not clear.