Lookup for List Item Id in SharePoint vs. Get List Items in K2

  • 20 March 2014
  • 3 replies
  • 5 views

Badge +4

In a SharePoint workflow one can look up the ID (or any other column) of a list item by comparing two fields which may or may not be IDs. In the below example I'm finding the ID of a Task by comparing the Created By between the current list (which is not the Task list) and the Task list. When the values match it returns the ID of the item from the Task list to a variable.

 

16689i7CAA3C52EB1398B4.png

 

In K2 I can retrieve information from another list by using the SharePoint List and Libraries Event and then finding the item by ID. But what if I want to return the Item ID itself as I don't know it, but I know other information to compare? Is it possible to duplicate this feature in a K2 workflow? To summarize:

 

1. List A has the K2 workflow running on it.

2. List B has some items created by the current author.

3. The K2 workflow will compare the authors (or any other column) between a column in List A and List B.

4. K2 returns the ID from List B when there's a match.


3 replies

Badge +7

Where do you want the ID returned to?  Do you want the compare to fire then return the ID to a SharePoint column?  Or would you like an email to be sent back to the user?

 

This sounds like it would be easy to do with SmartForms.  For displaying the comare and return information to the user.

Badge +4

I'd like the ID returned within the workflow itself or to a SharePoint column. I do not have SmartForms. I either need to accomplish this is a Code Reference Event, a Smart Object, within the workflow, or as a last resort to write an ASP.NET event which handles this task. We are trying to use K2 exclusively rather than event handlers, but I may have hit a limitation here.

Badge +4

I accomplished this by writing custom code in a webpart outside of K2 so this post can be marked as a solution.

Reply