Loop through one DT1 and update values in another DT2

Looping throught DT1 and placed DT2 inside DT1 loop

Need to update the captured values from website into DT2, based on the number loop in DT1

For example : if DT1 has 7 rows to process then activity will perform data capture in 7 products and needs to update each 7 products values in Dt2 in 7 rows

How to update the columns in DT2 based on DT1 row count

@Sathish_Kumar_S

  1. build a new datatable which is called dt2
  2. loop your Dt1
  3. extract values from web if it is Table extraction that will be data table.
    4.use that data table or use add data row activity to add the values to Dt2
    This loop will continue for all rows from DT1

Already build D2 and looping through DT1

Not sure how to add captured values in each row in DT2 based on the row count in DT1

Can you add sample steps?

This is Dt2 :slight_smile:

Need to add out_ModelYear value to DT2

Dt1 has 7 rows and 7 rows needs to be updated in DT2 ( All the values from different 7 products)

use add datarow activity to add the values in DT2

Hi @Sathish_Kumar_S

Use For each row in datatable activity to loop through dt1

Identify the values to be updated to DT2

Use Add data row activity for adding data row to DT2

Your code should look similar. Attaching for reference

Dt2 avalable inside another Xaml and placed inside dt1 loop

Add data raw activity added but still the values not appending when it is looping.

Looks like it is replacing the values in first row of Dt2

okay - I thought you are building a new dt2 table

So you want to update DT2 OR Add a new row below the existing rows in Dt2??

if it is update - what is the unique common value between DT1 and Dt2?

@Sathish_Kumar_S

@Sathish_Kumar_S

Because you are using Build Data Table activity inside for each loop, you need to place Build Data Table activity outside for each. If we place inside for each every time it creates new datatable

Regards,

1 Like

There is no common values between DT 1 & DT2

Just want to loop throug DT1

Below values will be available in DT1 and need to open each Base part ( Highlited in RED) and capture few values from website and added those values in DT2

DT2 column details :slight_smile:

Expected Dt2 output :slight_smile:

In that case - Build the data table with all the required columns . Build before you start looping through DT1

While looping through DT1 - Identify all the values that needs to be captured to Dt2. You can use different string variables if needed

Use add data row activity inside this loop. keep at the end

Inside the {}, keep the values in the same order of columns in Dt2. It should work as expected

@Sathish_Kumar_S

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