How to use nested for each loop in mentioned Scenario?

yes, you are getting my point,

Will you please elaborate in detail.
Should i use filter before or after 2nd for each loop ? :confused:

You don’t need Filter Datatable. If you want to remove a row use Remove Data Row and pass it the index of the row to delete.

Doesn’t it need a filter to find that directory?

It just doesn’t want to remove the data row. I understand that he wants to remove the row that matches the rule he set, is it correct?

1 Like

Hi @Prabin_Chand,

dataTable A = [“A”,“B”,“C”,“D”,“E”]
dataTable B = [“A”,“B”,“C”,“D”,“E”) ,“F”,“G”]

What kind of output do you want to get from these two tables?

For example ;

Find F and G from these two tables.

i want loop to ignore the match cases and start from another element

You have to stop thinking of it this way. It’s not about where it starts. If the matched element is the 6th element you don’t want to start at the 7th element, you want to start at the 1st element and skip the 6th element.

no sir, you are not getting my point.

if the matched element is the 6th element, i want to start from 7th element and skip 6th element as the match is already found

Hello @Prabin_Chand

Are you trying to find the matchesd data in both the datatable? Or can you plz tell whats is the acutual requirement with 2 datatable.

It would be better if you can provide the expected output. Or are you trying to do some process based on the match in 2 datatable?

Actual Requirement: I need to compare two column from two different sheets and if match is found need to copy the cell value and paste into another work sheet on the comparing sheet and if value is not match leave the cell empty and repeat the process.

Hello @Prabin_Chand

In this scenario its better to use the linq query than using the multiple for loops. You can refer the similar requirement in the below post.

I’m not able to get those including the links you shared

Hi @Prabin_Chand ,

Could you maybe provide input and Output example data for this Scenario? If you could provide us the Excel Sheets it would be quicker for us to assess the logic and provide you a better solution.

On a glance of your requirement, it does seem that you could perform these task using Join Datatables Activity as well, and then performing the required update using a Single For Each Activity.

A Similar Logic is used in the below Post :

Let us know if this doesn’t help.

Thanks. Issue Solved But not with these suggestions

But what about the 1st through 5th elements? Don’t you want to see if any of those match the 2nd item in the outer loop?

I think I’m not capable to make you clear understanding about my requirement. Thanks Though

@Prabin_Chand ,

We would request you provide the solution that you have used for this case and close the topic. This would help other users to resolve similar kind of issues.

1 Like

Can you provide the solution

Used nested for loop as usual and mentioned if condition to check the value is equal to sheet 1 and sheet 2 but there is no else . and assigned the value that meant to be assigned.

Can you share the .XML file

Main.xaml (38.3 KB)