Solved

How to get all task approver comments posted in the list item


Badge +4

I have not seen a post on this topic in the Nintex Automation Cloud forum yet. How do I get all task approver comments written back to the list item? Is there a tutorial somewhere I can follow?

 

I have successfully done this in NAC in other workflows where there is only one approver using the “First Response” object, but I have multiple people approving tasks in a new workflow. How can I get all of the info written back to the list item?

 

I’m assuming I’ll have to do something with a collection variable to utilize the “Task responses” collection, as shown below, but I’m unsure of how to execute this logic to achieve what I’m looking for. 

 

Could someone please outline the logic steps if this is possible? 

 

I’d like to use this format: (Outcome) Task Responder - Current date and time - Comments

 

icon

Best answer by Erwee 18 March 2024, 12:26

View original

13 replies

Userlevel 5
Badge +13

Hi @GoIllini 

@brandiwoodson ‘s response explains it in much better detail 😁

Jake

Userlevel 4
Badge +14

 

  1. Add a loop for each action after task

     

  2. Create a text variable for your task or “approver” comments.
  3. Add a branch by condition to build your text string. 

     

  4. Add a create a text string action to each branch on the branch by condition action.
  5. Configure create a text string for the right branch like below:

     

  6. Configure the create a text string on the left branch like below: 

 

From there, pass your new text variable through to your ML text field in SharePoint list. (Plain text works best for this or rich text - not enhanced rich text)

Userlevel 4
Badge +14

Hi @GoIllini 

Yes you are correct you will need to store them either individually or collate them together and send them all at once, for efficiency I would collate and send at once. 

First you need to do a loop for each response:

 


Inside use a create a text string action enter the values from the current loop (each response) don’t use the task variables:


Now the trick to combine values is to store this string into a variable and use that variable in the builder its self like this:


As the first loop creates, All Responses will be empty so it just enters the first value, the second time the loop comes All Responses will be filled with the first and the second is populated and both are stored, this repeats for every approver so it will build up with each loop. 

After the loop the variable ‘All Responses’ will have the value you can store back to the Sharepoint, if formatting is a must then you can use the same approach to build a HTML table.

 

Hope this helps 

Jake

Haha, I tried. Jake beat me to it! :)

Userlevel 5
Badge +13

Haha @brandiwoodson I did beat you to it but I think your response is much more detailed! I am going to edit mine out!

Userlevel 4
Badge +14

Haha @brandiwoodson I did beat you to it but I think your response is much more detailed! I am going to edit mine out!

Why thank you sir! 

Badge +4

@brandiwoodson thank you for steps and screen shots! I’m stuck on this part of your tutorial, step 5. 

How are you getting those variables to build the string? The items in the Task Responses Collection are still greyed out. My only accessible options remain the attributes of the “First response” only. I’m still getting just the first approver info when I run this, not the second or third approver too. 

 

 

Badge +3

Hi @GoIllini. It seems like you are trying to insert directly from the Task action. As shown, you should first add a Loop For Each, that references the Task action outcome. In the Loop For Each you will be able to work with the current item.

Badge

@brandiwoodson I tried following your post. I am missing the “Break” variable and the “Task Comments” variable. I screenshotted my workflow below:

In both of the text strings, I am missing the “Break” and the “Task Comments” variables. Any advice on what I am doing wrong on this and how to resolve?

 

Badge +4

I too am missing the break variable. I know that is set separately, but I’m not sure how to get a line break into a variable. For now I’m just using “****” at the end of the string to identify some sort of separation.

As for the comments, that will be in your Loop for Each > Current Item (object) > Form Variables (object) >  Comments 

 

Badge

@GoIllini  the Current item variable is showing as a text option so I don’t have the Form variables or the Comments variable connected to it. Can you tell why based on the screenshot?

 

Badge +4

Please see step #1. Not sure, but I’m guessing you didn’t setup your For Each variable correctly. I failed the first time at this step as well. The Task Responses object must be in the for each variable before you can do anything. 

Badge

You are correct, I did not do the first step correctly. Now I am wondering how to view/export the results? @Jake mentioned storing it to SharePoint. I’m not familiar with how to do this through Nintex and I did not see any instructions any where else for this.

Badge +4

Once you have all your outcomes/comments stored in that variable, you then use an “Update Items” for SharePoint Online action to write the data back to the list item.

This will be the first action immediately after the loop, not inside it. 

Once you configure the action, click “add field” to choose the field where you are going to store you outcome/comment. 

In your Update Items action, use ID = ID for your condition, also shown in screen shots here.  

 

 

 

 

Reply