I have a SP 2013 WorkFlow Task List that I'm using as a approve/deny feature. If the task is rejected, I wish to capture the comment left in the WorkFlow task and then email the user.
Is this possible?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
The “Approver Comments” column only will be shown in the list when you set “Require content approval for submitted items” to “Yes” in the list, and we need to click “Approve/Reject” in the ribbon to add the comments.
In SharePoint 2013 workflow, there is no “comments” in the task form, so if you want to let users be able to add comments when approving the task form then we need to use 2010 approval workflow instead. However, the “comments” in the task form is different from the “Approval Comments” column in the list.
If you want to use the comments in the 2010 workflow task form to update the “Approval Comments” column in the list, then we can create 2010 workflow following the steps as below:
Create a List Workflow associated with the list and set the workflow to start when an item is created, then add the “Start Approval Process” action at first.
Click on “Approval(14)” to edit the task process and Click on “Change the behavior of a single task” in the “Customization”.
Add the “Set Workflow Variable” action in “When a Task Completes” section as below to set a workflow variable “comments” to get the value of comments in the user dialog form the task.
Add the “Pause for Duration” action to pause for 1 minute.
Add some conditions to check if the status of the current workflow is “Approved” or “Rejected”, and then set Content Approval Status to “Approved” or “Rejected” with “Variable: Comments”.
Publish the workflow and test it in your environment.
The workflow is shown as below:
I found the solution: use a task assignment action, create a Workflow variable and use this for the variable field lookup:
Data source: Association: Task List Field from Source: Comments Return field as: String Find the list item section: Field: GUID Variable: TaskID
Then reference the variable wherever you need it. This article helped me out a lot. Here.