cancel
Showing results for 
Search instead for 
Did you mean: 

Work Queue - Getting latest item completed based on timestamp and Tag

srirammuthukris
Level 3
We have a situation wherein we need to get the last item from workqueue based on tag(both completed and exceptioned). This is required to start the next process(We will be checking the previous process status). Please suggest how to accomplish this.
2 REPLIES 2

John__Carter
Staff
Staff
Get Completed Items (or Get Exception Items or Get Report Data) to get a list of item IDs, then Get Item Data for each ID. Yes, it's much harder than it should be, but it's the only way at the moment. If there is a way to mark the last item at the Mark Completed/Exception stage, then it might make finding it in the next phase easier.

MantasPadimansk
Level 4
There is a stupid way which I used to check lastly added pending item. I got all pending items, reversed the collection and first item in the collection is the one added last to the work queue. At least that worked for me while I was testing my robot, so probably same thing could be applied here, though if there is not item cleanup reverse operation may be a wrong approach for large collections.