I need to copy data from data table1 to data table2 which has different column names

Hello,

Good Day.

I have 2 different data tables with different column names

data table1
|Invoice No|GR Date|GR Document|
|G12345|10/26/2023 0:00|ABC123|
|G12354|10/26/2023 0:00|ABV65|
|G12363|10/26/2023 0:00|ABH987|
|G12372|10/29/2023 0:00|BVG987|
|G12381|10/28/2023 0:00|JKH654|

Data table 2 (Blank Data table with correct data types)

Document Number|Year|Reference|Payment Reference|Text|Doc.Header Text

Now I need to copy the data from Data Table 1 to Data Table 2

Document Number = Invoice No
Text = GR Document + GR Date

I am not able to visualize how I can achieve this.

Appreciate your feedback

Regards,
Manjesh

HI @manjesh_kumar ,

Do for each row for datatable1 and add data row to data table 2 inside the loop.

Add Data row parameters → Datatable (target datatable) and ArrayRow (array of values separated by commas in the same order as your second datatable columns)

Cheers

Hi,

How about the following sample (without loop)

Sample20231130-4.zip (3.2 KB)

Regards,

@Yoichi ,

Thank you , how do you do it with a loop.

Regards,
Manjesh

@Yoichi ,

I could not import the xaml, it is crashing. My studio version is 2022.10.3

image

Regards,
Manjesh

HI,

How about the following?

New Object(){row("Invoice No").ToString,"","","",row("GR Document").ToString+row("GR Date").ToString,""}

Regards,

1 Like

Hi,

Can you try the following sample? I just re-created it for lower version.

Sample20231130-5L.zip (3.0 KB)

Regards,

Dear @Yoichi ,

This works and much easier …:slight_smile: and this can be used for multiple columns.

Appreciate the support as always.

Regards,
Manjesh

1 Like

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