How to Filter items from Orchestrator using property 'Filter' in activity Get Transaction Item

Dear friends,

I have items in Orchestrator queues with one of the specificContent is in date format, say the name is ‘beginDate’. I marked this specificContent as the reference when I export this to ORCH using activity ‘Add Queue Item’. Now what I want is: taking the items and process is based on the earliest date of the queue. How can I arrange best?
I was thinking if I can make use the filter property of Get Transaction Item?

image

Thank you for your help :slight_smile:

Reference is a string field, you wont be able to properly use this for a date value…

HI bcorrea,

Thanks for the answer. I was afraid of this.
Do you have any other alternative for my situation?
Thanks!

you could get them all as text, put in a list, convert them all to real DateTime and then choose the one you want to process, maybe need to go back to a new getqueueitem, this time retrieve only the one to process.

@Nazarius

I will share in a little time an alternate. There is a chance close to your directed approach

@Nazarius

Lets assume following:

  • WorkQueueItems are added:
    • specificContent has a “beginDate” and is of DataType: DateTime
    • Reference is set to an unique ID

Get Queue Item / Transaction Item will not really help, due it is returning a transcation item ans set its status immediately to In Progress

Get Queue Items will help:

we do filter e.g. for the items in New state and will return all these items as a list

Now the list can be filtered to the earliest TI within an assign activity and will give back the earliest TI

Statement: ListQueueItems.OrderBy(Function (qi) qi.SpecificContent(“beginDate”)).First()
grafik

this Item can now be used for fetching it with get Transaction Item and with the Reference ID we adress just the earliest one with FirstQueueItem.Reference
grafik

It is recommended to incorporate some exception handling e.g empty Queue and there will not be an earliest TI. But in general it worked.

Let us know your open questions

Dear PPR,

Thank you for this precious help.
I will try to implement it today and see if it works.
Will update the answer soon :slight_smile:

UPDATE:
I tried to sort the datatable ascending before exporting it to ORCH and it performs the queues ascendingly. anyway thank you very much for your input guys! keep the forum alive :slight_smile:

@Nazarius
Does mean you need a desc ordering?

So just use: ListQueueItems.OrderDescendingBy(Function (qi) qi.SpecificContent(“beginDate”)).First()

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.