Remove duplicate data from excel based on Transaction Reason

I have an excel file which contains details of queue transactions. There are certain transactions which got retried after app exception but in 2nd attempt they succeeded. I want to remove rows of 1st attempt of those transactions which got successful in 2nd.

image

@harshit.gupta

Let’s say your DataTable is dtInput. And then try below expression.

dtOutput = ( From row in dtInput Group row by a = row("CustomerID").ToString.Trim into grp = Group Where grp.Count > 1 Select grp.Last).CopyToDataTable

i am getting error: Source contain no datarow

@harshit.gupta Instead of updating every time the transaction item encounters app exception, you can update the status once the final retry completes.

  • if you want to implement this,take if activity and write the condition like below.
TransactionItem.RetryNo = 2
  • 2 is the final retry number. This you can get from config. When you are getting from config make sure you convert it to double
TransactionItem.RetryNo = CDbl(in_Config("QueueRetries").ToString)
  • In then block update the excel, in else block leave it as empty

@harshit.gupta

It’s because if we don’t have any duplicate rows in that file.