Using for each row in data table 1, extract unique id
Using Filter data table activity (pass unique id) for table 2 and use for each row in table 2 filtered records to make one record out of multiple records based on business rules.
Outside loop of table 2. Add variables in data row of table 1 columns
Add transaction item to queue at end of both loops
Issue : Sometimes getting unwanted values of different unique id and add to another unique id columns in Table 1
you can check if the first loop can be avoided when using following statement: dtUniqueIDs = dtOrig.DefaultView.ToTable(True, {"YourIDColName"})
So the second loop can iterate over dtUniqueIDs
sounds like a data grouping on ID
here the other statement should be cross-checked on possible side effects
when the update is placed on wrong dt1 rows, then maybe the dt1 unique ID logic is confused. We would recommend doing the first analysis by debugging and tracing the flow.
As mentioned by Raja, if possible share also some more details on sample data and implementation details with us.
Table 2.xlsx (9.0 KB) Table 1.xlsx (8.6 KB) Output Data table.xlsx (9.1 KB)
Find the attached tables and expected output.
Table A contains unique values
Table B contains multiple records of same unique id
It seems issue appeared when processing second loop inside first loop to consolidate values.
I have tried both methods : 1. Join different data tables with unique id 2. Pass required values from second loop and update into first loop as row items during processing of first loop.