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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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
    502 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,583 Super User 2026 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 247 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 164 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 138 Super User 2026 Season 2

Last 30 days Overall leaderboard