I checked your workflow file. In your Filter datatable activity, you are trying to filter your datatable by a value that is contained in a variable. But as I understood the flow of your workflow, this variable gets the value from another loop. And that loop is getting executed until it reaches the last record of the datatable. So, by the time it gets to this filter data table activity, that variable only has the value of the last record of that datatable.
In this scenario, it will filter your datatable only by the last record. It will not iterate the entire datatable and find matches. So I believe the logic used here is not right. Additionally, you can find the matching records easily by using Join data table activity.
I have done the same scenario here in the attached workflow which I created for you. Please have a look to see whether it serves your purpose. You can incorporate the logic used here to get your workflow working as required. In this workflow, it extracts data from two excel files. Then compared the two using join data table activity with Inner Join to find matching records. Then I loop the matching records data table with the datatable I got by the read range of the first excel file. In the loop, all matching records are added with a “Yes” flag to a new column. FInally, it adds the new data back to the first excel file.
I guess this is what you want to do…
MatchDataTables.xaml (9.3 KB)
If this works for you, please mark the answer as the solution so it could help others as well
Let know how it goes