Forum Discussion
Lam01007
Dec 12, 2019Copper Contributor
Join 2 SharePoint List
Hi All,
I would like to join 2 lists and display in a single list.
Let say, I have following 2 lists:
Product
| ID | Product Name | Unit Price |
| 1 | A | 100 |
| 2 | B | 200 |
Order
| ID | ProductID (Foreign Key) | Quantity |
| 1 | 1 | 5 |
| 2 | 1 | 4 |
| 3 | 2 | 20 |
Finally, join the above 2 list by the ProductID, and output into following result list:
| OrderID | Product Name | Quantity | Unit Price |
| 1 | A | 5 | 100 |
| 2 | A | 4 | 100 |
| 3 | B | 20 | 200 |
It should be achieved by using the "Content Query Web Part (CQWP)" in previous version of SharePoint, but how can I achieve the above in the Modern SharePoint Online? by using Highlight Content Web Part? or use client-side script to call REST API to join the list and display in a html table?
In advance, can I also apply the SharePoint default list feature into the result list, e.g. Search, sort/filter by column
Many thanks,
Lam
1 Reply
- You basically need to use PowerApps to accomplish this in Modern UI. There are multiple ways of accomplishing it, but search around and you should be able to get how to accomplish it. One example here. https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Syntax-for-joining-tables/td-p/61387
Other ways of accomplishing it, but you can't really do this inside of SharePoint itself. You might be able to get creative with PowerAutomate flows to come up with a 3rd (Joined) type list but that could get risky.