Filter Queue Item based on field Date

image

User ID Name Date Header
2 Sonal 31/06/2019
1 Manish 20/04/2019
21 Ron 14/07/2019
3 Julie 31/07/2019

Trying to get transaction item details based on oldest item (transaction item is having date element = dd/MM/YYYY.

Used below functions in assign activity but not getting first transaction based on oldest date.

ListQueueItems.OrderDescendingBy(Function (qi) qi.SpecificContent(“DateHeader”)).First()

or

ListQueueItems.OrderBy(Function (qi) qi.SpecificContent(“DateHeader”)).First()

Results in order:

3 Julie 31/07/2019
21 Ron 14/07/2019
2 Sonal 31/06/2019
1 Manish 20/04/2019

@ppr - Any inputs??

@Sonalk
you need to parse / or to cast the date into datetime

assumption date is stored as string:
ListQueueItems.OrderBy(Function (qi) DateTime.ParseExact(qi.SpecificContent(“DateHeader”).toString, “dd/MM/yyyy”, CultureInfo.InvariantCulture)).First()

ensure System.Globalization is imported (imports panel close to the variable panel)

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