@Mathkar_kunal Please try the below steps:
Step 1: Read the Excel file
Use Read Range Workbook or Excel Read Range activity.
Output DataTable:
dt_Input
Your dt_Input will contain data like:
Ticket Key | Work Order | Time | Status
Step 2: Create one output DataTable variable
Create a new variable:
dt_Output, Type: System.Data.DataTable
Step 3: Add Assign activity
In the Assign activity, use this:
dt_Output = dt_Input.AsEnumerable().
GroupBy(Function(row) row(“Ticket Key”).ToString.Trim).
Select(Function(group) group.OrderByDescending(Function(row) DateTime.ParseExact(row(“Time”).ToString.Trim, “dd/MM/yyyy HH:mm”, System.Globalization.CultureInfo.InvariantCulture)).First()).
CopyToDataTable()
Step 4: What this logic does
It will first group the rows based on Ticket Key.
For example:
EJCS-27089
is available two times.
Then it will compare the Time column:
25/05/2026 12:26
25/05/2026 13:25
Since 13:25 is the latest time, it will keep that row and remove the older row.
So this row will be removed:
EJCS-27089 | User Addition on Confluence Space | 25/05/2026 12:26 | Pending
And this row will be kept:
EJCS-27089 | User Addition on Confluence Space | 25/05/2026 13:25 | Pending
Step 5: Write the final DataTable back to Excel
Use Write Range Workbook activity.
Input DataTable: dt_Output