How to write Nested For Each Row for data compare between two data table


I have two excel sheet. Excel attachments are below:
__ConsolidatedLedger.xlsx (11.5 KB)

01-10-2021_05-10-2021_ProcessedTrialBalance.xlsx (8.1 KB)

my requirment is I have to compare two excel sheet and have to find matched record if mismatched occour will terminate the workflow.

I have used nested for each row to compare both excel but some how it is not working. please check my nested for each row workflow.
datacompare.xaml (10.8 KB)
would please check my workflow and suggest me where I have been doing mistake.

Thanks in advance.


Just now checked your code is working perfect on comparing the values between two excel but it did not meet your requirement on if match is not found we should terminate the work flow. For that one additional throw activity we have to keep in the else part like below.

i suppose this is business exception you can create expression like below in throw activity. whenever we got mismatched for any one of the entry flow will trigger throw activity and it terminates the process.

expression in throw activity:

new BusinessRuleException(“The values are not matched”)

if you want to throw it as general exception you can give like below. Thanks.

new Exception(“The values are not matched”)

1 Like