I have two Excel Files and from each Excel file i have to verify a value from a row. But every it compare the values the for each row loop is going for all the values in the excel file

I have two Excel Files and from each Excel file i have to verify a value from a row. But every it compare the values the for each row loop is going for all the values in the excel file. When i use the break activity then it is not going to the other workflows in the project and make the condition to always false. In this project if the conditions becomes true for example it finds the value in one excel file and verify in second excel file i am typing a comment that data is matched but it is typing the comment for many times as many as there are number of items in the excel file.
One more thing this is also taking more time to read all the excel file. is there any method to minimise the time it take. Can we do it by FilterDataTable Activity?

Hi, just to clarify,
Your “Read Range for Helath Activities” has a link to a “Sheet2” which doesn’t work because that file only has “Sheet1”

Also, if you are sure that the value can only match ones you need to use a break activity in two places, one in the end of the True condition of the 2nd For Each Row Activity, and the other After the 2nd For Each Row activity.

This is only if you want to stop processing the values in the 2.xlsx ones it gets matched, and immediately exit processing 1.xlsx because it has to be matched to enter processing 2.xlsx.

Let me know if this is what you wanted, because I used the handler you sent as the base.

Oh yes sorry for the mistake because the excel file is large and contains multiple sheets that’s why i make it simple for you.
I use break activity the same you mention but it breaks the whole process and didn’t go the other workflows.
Other thing is that can we make it by using filter datatable ? because for each row takes 1 minutes to process and check these 2 excel files

Hi @zeshanm9,

I was going through your workflow… Need to get few things clarified… From the first excel, you have a read range and you loops through the data. Then check for a condition, if its true, then you mark the out_MakanilsAccepted as True.

Within that same loop, you have another read range to read the second excel file. So basically, for each row in the first excel, you read the entire second excel.

And I don’t see a reason to why you need to read the second excel for every row in the first… And I don’t see a connection between the values of the first with the values of the second…

Have I missed anything here? Please correct me if my understanding is not correct on this… That will help me to figure out a solution for you…

Hi… Sorry for my late reply… based on my understanding, it looks like there is no dependency between the two excel files right?

If so, you try the same thing separately… Look at the workflow I shared… Does that logic work for you?

CompareSheetsData - Copy.xaml (12.5 KB)

Let me know if it works for you to achieve the purpose :slight_smile:

2 Likes

okay so your second break would be to exit the first For Each DataRow activity. So you should be invoking that other workflow after the container of the For Each DataRow not Inside it.

I believe that is why you are having that problem.
regards

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