Extracting Data from Approver comment

  • 8 January 2018
  • 3 replies
  • 5 views

Badge +3

Hi,

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)

Thanks!


3 replies

Userlevel 5
Badge +14

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.

Badge +7

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.

Badge +2

Hello Emha,

 

I did the same but i have 5 approver and first response is configured but i am unable to extract the comment plz help me

Reply