How to skip transaction Based on Excel Column

I am working on project which is based on Excel, In this we received a mail containing excel attachment which have only one row in Each Excel (Each mail Contain Only One Excel).

In this
If “Client Code” column is blank, then skip the transaction. and Must go to Next transaction.

How we can achieve that ?

Hi

hope the below steps would help you resolve this

  1. use a READ RANGE activity and get the output as a datatable of that excel file
  2. now use a IF condition and mention like this

dt.AsEnumerable().Where(Function(a) NOT String.IsNullOrEmpty(a(“Client code”).ToString.Trim) ).CopyToDatatable().Rows.Count.Equals(1)

if true it goes to THEN block or goes to ELSE block based on which you can process the transaction

Cheers @Ajinya_jorwekar

If it is a REFramWork Project When you Send the Row Item as a transaction Item you can put this Expression if (String.IsNullOrEmpty(row(“Client Code”).ToString) in then (Throw Exception or Log Message or Leave it Empty and in Else you can make your Activity or Task))

if its a Work Flow or Sequance after Reading the Excel Sheet you Can Use For Each Row Data Table and Put the same Expression above.

@Ajinya_jorwekar

please try this which will give true or false

  1. Read the data into Datatable
  2. dt.AsEnumerable.Any(function(x) IsNothing(x("ClientCode")) OrElse String.IsNullOrEmpty(x("ClientCode").ToString.Trim)) use this in if condition
  3. on then side ignore and dont process and on else side do your actual process

@Ajinya_jorwekar

in Process transaction

use if activity

hope this helps