Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

How to stack two list results together

(0) ShareShare
ReportReport
Posted on by 29

I have two SharePoint lists.

 

List1 has an ID of 39.  List two has a lookup column that points to List1 ID (in this case 39).  It is always a 1:1 relationship and list 2 will never have duplicate rows with the same lookup ID.

 

What I want to do is combine these two sharepoint list items in Power Automate and create one result by stacking the tables next to each other.  I've tried a Union() but it creates a an additional row.

 

Like this:

2022-06-13 15_45_53-Book1 - Excel.png

  • mnoah Profile Picture
    mnoah 29 on at
    Re: How to stack two list results together

    @abmYes thank you I will send the lists to an Azure Function instead.

  • abm abm Profile Picture
    abm abm 32,252 on at
    Re: How to stack two list results together

    Hi @mnoah 

     

    I am not sure but have a look on SharePoint API or Graph API.

  • mnoah Profile Picture
    mnoah 29 on at
    Re: How to stack two list results together

    Yes I could do that if I wanted to build the JSON object manually. But I have many columns of data and columns may be added in the future.  How to build it dynamically?

  • abm abm Profile Picture
    abm abm 32,252 on at
    Re: How to stack two list results together

    Hi @mnoah 

     

    Like you mentioned Union() expression doesn't work for the scenario you described. What you could do is read the first list then filter the list 2 using list 1 id. Get both results into a JSON format like below in a compose action step.

     

    {

      "Id": 39,

      "Name": "Joe,John"

      "Date": "6/10/2022",

      "LookupID": 39,

      "Department": "HR",

      "Resource": "Yes"

    }

     

    Next map the compose output in an array (Append array)

     

    This way you can build all the data in one row.

     

    Thanks

     

     

     

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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,609

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,420

Leaderboard