cancel
Showing results for 
Search instead for 
Did you mean: 

Select oldest item from a work list where activty name = x

RichardTravers
Level 2
Has anyone written a way to read a work item select list that contains multiple items with a date and a unique activity identifier? Need to select the oldest item with the unique activity identifier, work it, then repeat until all the activities in the queue of that type are complete. This would be in IE and HTML. It is a work queue list where each activity type is unique. The bot would only action the items of this specific activity name and work them oldest to newest. Example using made up list below: Bot to work only the Pizza items in the list in order from oldest to newest. There is a select box next to each item and a select item action that will be used. Bot reads the lists, selects the oldest Pizza activity, then does the select item action, and then runs the actions specified to close out that item. Once done, the bot then re-reads the list, finds the current oldest Pizza item, and repeats the process. This loops until all Pizza items are clear in the queue. Pizza 9/25/2018 16:30 Pasta 9/25/2018 16:31 Salad 9/25/2018 16:32 Pasta 9/25/2018 16:33 Salad 9/25/2018 16:34 Pizza 9/25/2018 16:35 Pasta 9/25/2018 16:36 Salad 9/25/2018 16:37 Salad 9/25/2018 16:38 Salad 9/25/2018 16:39 Pasta 9/25/2018 16:40 Pizza 9/25/2018 16:41 Pizza 9/25/2018 16:42
1 REPLY 1

david.l.morris
Level 15
Hi, The process you describe sounds like you essentially have it figured out. Are you asking how to accomplish it technically regarding interfacing with IE or just to verify your overall approach and the steps involved? I haven't attempted this specific thing, but I imagine I would do it similar to the way you describe. A couple things I would suggest adding in: (1) Even though there is a Work Queue of sorts there, I would still add that data to a BP Work Queue. (2) While interacting with either the Work Queue or the list in IE, I would have an environment lock that makes sure only one bot can retrieve from the list at a time so that you don't have two attempting to pick up the same one. Either this, or as BP itself suggests, have only one bot retrieve from this list and add it to a Work Queue and allow other bots to work on that Work Queue. The first bot's job would be to add items to that work queue and mark items complete on this list when they are done (of course depending on how this workflow is supposed to happen -- I can't tell if you're supposed to mark when starting and mark when complete or just one of them). Also, is this list always ordered from top-down:oldest-newest? If so, I imagine I'd 'essentially' ignore the datetime stamp unless I need to use it and I would simply take every Pizza item starting at the top and working my way down. If I needed the bot to understand the datetime, then I'd extract the datetime from the pizza strings and cast it into a Data Item of datatype DateTime. As far as literally reading the list itself, that's dependent on how that HTML page is designed. Sometimes it's really easy to read it directly into a collection, but sometimes you have to loop through it and get each piece of data individually. If it's the former, then this wouldn't be that painful. Respectfully, Dave

Dave Morris, 3Ci at Southern Company