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 Automate
Answered

Merging Lists in PAD

(0) ShareShare
ReportReport
Posted on by 18

I have 2 lists

 

 

List 1List 2
A 
 C
B 
 D

 

I want to merge these 2 to get List 3 which replaces the blanks and in the order A,C,B,D

You might say to use merge list, subtract list. Those don't seem to work.

Merge list gives me - A,,B,,,,C,,D

Subtract list and join gives me A,B and C,D when joined is A,B,C,D

So please let me know if this is a limitation or it is possible

I have the same question (0)
  • UshaJyothiKasibhotla Profile Picture
    203 Moderator on at

    You can convert these lists into datatable and then you can use find and replace datatable activity 

    Then you can replace blank value with the value in the next column

    Hope this helps

    Usha

  • luckyra Profile Picture
    18 on at

    @UshaJyothi20  where is the option to convert list to table?

  • Verified answer
    cwischnewski Profile Picture
    142 on at

    You could do sort of a correlated loop through these lists.  Get the larger of the two .count values, then loop from 0 to that larger count value (minus 1, since the lists are 0 based, the last item is count - 1).  Inside the loop, first check if List1.count <= LoopIndex and if it is add it to your merged list.  Then do the same for List2.

     

    If List1.count >= List2.count

      MaxList = %List1.count - 1%

    Else

      MaxList = %List2.count - 1%

    End

    Create new list NewList

    Loop LoopIndex from 0 to MaxList with step 1

      If LoopIndex <= List1.count

        Add item List1[LoopIndex] to list NewList

      end

      if LoopIndex <= List2.count

        Add item List2[LoopIndex] to list NewList

      end

    end

  • luckyra Profile Picture
    18 on at

    luckyra_0-1702570801633.png

     

    Something like this? This worked for me when using Is empty the <= argument gave A,,,C,,,B,,D

  • UshaJyothiKasibhotla Profile Picture
    203 Moderator on at

    I mean to write both lists in an excel and then read that excel then we get a data table 

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