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 / Combine two or more th...
Power Automate
Suggested Answer

Combine two or more than list variable into one datatable

(0) ShareShare
ReportReport
Posted on by
Hello everyone,
I am having a bit of a hard time trying to combine two or more than two list variables into one data table.
 
Final Aim - New Data Table
Column a (List variable) Column b (List variable)
AAA A
BBB B
CCC C
 
Currently, I have two list tables that were extracted from other data. My original purpose is to change the data table column order for the original data table, which:
 
 
After I used the retrieve data table column in the list action, I successfully made all the data table columns into a separate list variable, which:
 
Column a (List variable)
AAA
BBB
CCC

When I use the insert row into the data table action for each action, for column a, it is successfully inserted into the new data table. However, when the operation for column b, the issues showed that: 
 
Correlation Id: ad02d1fe-50e4-4062-ae3f-d4dda13c8467 
The amount of values provided to be added (1) don't match the columns of the data table (2).
 
I also tried to use the merge data tables action, which inputs the two lists of variable data into two different data tables. But the result is that column B starts from the next free row of column a in column b.
 
Column a (List variable) Column b (List variable)
AAA  
BBB  
CCC  
  A
  B
  C
 
Can I ask anyway to solve the issues? Thank you all!
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,522 Super User 2026 Season 1 on at
    If you have two lists then you can create a merged data table from them by first creating a datatable and then using Loop to insert the list values into the data table one list item at a time. The loop loops the length of the one of the lists - 1 (since arrays and datatables are 0 based). 

    Then Insert row into data table you insert both lists item one by one with the LoopIndex: %[ListColumnA[LoopIndex], ListColumnB[LoopIndex]]%


    Like so:



    Result:


    Or if you have two data tables that have one column then insert the missing column into one of the data tables. Then loop through the other one data table with for each and update data table item.

    Like so:



    So before the loop starts the DataTableA looks like this:

    then after first loop it DataTableA looks like this:


    And at the end it looks like this:


    Hope this helps

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard