(SP) get list item reference - How to get data from last created list item?


Badge +3

I want to use "get list item reference" to return data from a sepcific list item. I need to return data from the last created list item. How can I do this? 

 

Is there some way I could filter to only return the last created item. ID? some sort of date field?

 

Help? please and thank you.

 

-Corey


12 replies

Badge +9

The world is kind of your oyster on this one. You can use an ID, a content type basically whatever peels your banana.

Badge +3

But how specifically would i set the filter for ID to it give the most recently created item? 

Badge +9

https://www.youtube.com/watch?v=ZPNRVkcjP-c#t=193

Badge +3

I appreciate the responses. The video didn't address my specific scenario. 

 

I get the general concept of how to set filters for returning list items. In my instance, the only criteria i have (filter wise) is that it has to be the most current (last item) created. 

 

Is there something like a "last" item in the context browser that i could drag into a date column?

Or could I specify the largest ID # in the list somehow?

 

My apologies if i'm incredibly dense and the answer is right in front of my face, but i'm new to workflow and to sharepoint for that matter.

 

 

P.S. I lost my mind when I read the comment about whatever peels your banana, as I am at work right now in a banana costume for halloween. 

 

Thanks

Badge +10

@Coru wrote:

 

P.S. I lost my mind when I read the comment about whatever peels your banana, as I am at work right now in a banana costume for halloween. 

 


Pics or it never happened. :)

Badge +3

After uploading this picture, I better get a **bleep** answer. heh, just kidding. 

 

I hope the people are appeased

 

 

13163iC7E0F888CE1287A5.jpg

Badge +9

I can't test right now as my VM is occupodo but you should be able to set up a rule to pick out the largest ID as they are created sequentially.

Badge +9

I gave it Kudo

Badge +9

Ya, when you're  grabbing the metadata you should be able to set up a function to pull out the ID you want.

Badge +3

well, i'll continue tinkering here. if you get a chance to look, that'd be awesome.

 

-Corey

Userlevel 3
Badge +9

Hi,

 

In server item event, you can write a code to query smartobject and get the waht ever data you want. You will need to figure it out how to write that code.. you can write code only in k2 for visual studio only.

Badge +3

Hi Coru,

 

if I understand you correctly: maybe this what you want.

 

  1. In the Activity where you want to want to determine the newest item (i.e. the one with the highest ID), go to Destination Users
  2. Click "Back"
  3. Check "Run this wizard in Advanced Mode"
  4. Select "Plan per slot"
  5. Select "Select a list field to determine how many slots should be created"
  6. Insert the SmartObject for the SharePoint List (if you do not  have it created yet, you must do so) > List Method > Get List Items > ID
    (--> this is the ID you will receive in the result)
    13304iCE0BC2465EB1CCEA.png
  7. The result should look similar to this:
    12115i3F4EB6CFDF4B6681.png

 

Is that what you want?

 

Markus

Reply