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 / 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,204 Super User 2025 Season 2 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

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard