Getting details of the user who actioned the workflow task

  • 5 February 2021
  • 4 replies
  • 175 views

So we have a requirement where we need to know who acted on a task and use that info in subsequent nodes in a workflow.

 

I have seen couple of community threads (see below) and solution in there seems either unnecessarily complicated or it might not work in our case because we assign task to K2 role which in turn has AD group.

 

<rant> Can't believe there is no return object from the task node which can provide this information. :-)</rant>

 

So I was wondering if it's easy to create couple of variables in workflow (say ApprovalCompletedByFQN and ApprovalCompeletedByDisplayName) and then set value of these variables from the K2 Form (using Current User object) when worklist item is actioned. 

 

Are there any gotchas I'm not aware of with this approach?
 


4 replies

Hi @Praveen123,

 

If your smartobject has those fields to store the FQN and DisplayName, there should not be any issues. Once you transfer the data to your variables in your workflow, you can simply use the smartobject method to store those fields. 

 

Kind Regards

Prineel

Only gotcha I have seen in the past is if you can action the work item without opening the form.  This would bypass your form actions for capturing the user id and passing it to the workflow.

 

If you’re attempting to gather that information within the workflow after the task was completed by a user, you could use the Task User object within the context browser on the right hand side. I believe these values will automatically map to the user who most recently actioned the task. I use a SmartObject method right after the Task to update relevant data within my SmartObject based on the Task User who actioned the Task. 

 

Another option would be to update your data from within the Form itself. You can utilize the Current User variables within the SmartForm to update relevant data once you submit your form.

 

 

presend2 wrote:

If you’re attempting to gather that information within the workflow after the task was completed by a user, you could use the Task User object within the context browser on the right hand side. I believe these values will automatically map to the user who most recently actioned the task. I use a SmartObject method right after the Task to update relevant data within my SmartObject based on the Task User who actioned the Task. 

 

Thanks for replying. Problem with using the Task User object is it doesn’t have the actual user details if the task is assigned to a role which has AD group according to this post -

(see the last reply in there).

I haven’t personally tried it though so might give this a shot too and see what it comes up with. We are on 5.2 version.

Reply