Get User Who Actioned task

  • 25 July 2012
  • 7 replies
  • 3 views

Badge +2

Hi, I have an approve/reject workflow.  The workflow has a destination set of two users.  Both have to approve to have the the workflow approved, but only one has to reject.  But I need to update a field based on the user who rejects.  How would I capture which one of the users has rejected?  I'm using a user object that is coming from a SharePoint list item, not a role or group.  Any help would be appreciated.  Thanks.


7 replies

Badge +8

Look at the Activity Instance Destination SmartObject.  As tasks are completed, the SmartObject for the task is updated with the user who completed the task in the Destination field.

Badge +2

This isn't returning the correct data for me.  Any other options?

Badge +10

What data does it return?

Badge +2

Actually instead of returning the username of the user who actions the task, it is returning the user name of our K2 server admin.  I thought that was odd...

Badge +2

This might just be a quirk in our environment.  But does anyone have any other workaround ideas?

Badge +4

Is it a SharePoint list smartobject then? Does the SmO use impersonation or is it using the service account? This might explain what you're seeing.


As far as a workaround, what forms are you using? If you're using InfoPath, for example, you could run a rule on submit that says basically "If formStatus = Reject, set XXX XML field to username()". From here, you could check the contents of that field in a line rule or whatever you need to make your decision. The same concept could be used in SmartForms or ASP.NET forms obviously. 


HTH,


Tyler

Badge +2


Good news, I got the Activity Instance data to work.  


 


This does bring up another question though.  So I have two users who need to approve the workflow in order for it to be marked as approved.  I need to update two different date fields depending on which approver has approved.  Is there a way to update each one as soon as action is taken?  I tried doing this with line rules, but the next activity doesn't run until both approvals have been received, i.e. one approver could approver today, one could approve tomorrow, but my date update fields will both have tomorrow's date because the update task doesn't happen until both approve.  Can I tie this into the destination slot somehow?


Reply