web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Merge/Concat Data tabl...
Power Automate
Unanswered

Merge/Concat Data tables in PAD

(0) ShareShare
ReportReport
Posted on by 15

Hi,

 

I have two datatable variables and I want to add all the values from DataTable2 to DataTable1. The tables have the same amount of columns. So, let's suppose this:

 

DataTable1: 2 Columns (Column1 - Column2) - 3 Rows

DataTable2: 2 Columns (Column1 - Column2) - 7 Rows

 

The expected result that I want is: 2 Columns (Column1 - Column2) - 10 Rows

I know I can achieve this with a for loop or even using Excel to paste the values and read all of them together. But those options don't work for me in my current use-case.

 

I was doing some research about using custom objects, JSON conversions, etc. but could not find anything useful. Maybe I can use some of the scripting actions available?

 

Thanks in advance!

I have the same question (0)
  • CU31080729-3 Profile Picture
    500 Moderator on at

    Hi,

    You can fallow the step as per given into the screenshot it may be work for you for adding one data table data to another table by using for loop 

     

    Chetan_Ninghot_0-1711093821214.png

     

    (Note:- if you got your solution you can mark as solution and gives kudos)

     

    Thanks & Regards

    Chetan Ninghot

  • JuanPuelloUSGBC Profile Picture
    15 on at

    Thanks for the answer, but as I mentioned in the topic, I know that I can achieve this using a for loop or using Excel, but I am looking for a more efficient way to do this and also avoid changes in my data (Could happen if using Excel approach)

  • Verified answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at

    Then I would do it with a script as you were suggesting.

    eetuRobo_1-1711096058693.png

    eetuRobo_2-1711096133071.png


    Before merge:

    eetuRobo_3-1711096185056.png

    After merge:

    eetuRobo_4-1711096204175.png

    eetuRobo_6-1711096243052.png


    Copy paste action to your PAD flow:

     

    Scripting.RunDotNetScript Language: System.DotNetActionLanguageType.CSharp Script: $'''DT1.Merge(DT2);
    DT1 = DT1.DefaultView.ToTable();''' @'name:DT1': DataTable1 @'type:DT1': $'''Datatable''' @'direction:DT1': $'''InOut''' @'name:DT2': DataTable2 @'type:DT2': $'''Datatable''' @'direction:DT2': $'''In''' => DataTable1

     

  • JuanPuelloUSGBC Profile Picture
    15 on at

    Thank you! This seems to work just fine!

  • GenAi Profile Picture
    80 on at

    How would you change this to merge multiple datatables. Lets assume there is datatable3,datatable4. Thank you

    GenAi_0-1718386708416.png

     

  • GenAi Profile Picture
    80 on at

    I figured it out. Thank you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard