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 Apps / Join multiple sharepoi...
Power Apps
Answered

Join multiple sharepoint lists and display specific data

(0) ShareShare
ReportReport
Posted on by 5

Hi, 

 

I'm struggling with joining several lists that are all joined by one specific bit of data (using lookup). I want to display specific data based on that one bit of data from those different lists.

 

I am very new to all this, so just having a go and learning as I go.

 

Below is a rough look at the data - in this case, the SiteID is text-based, and using lookup in each other lists to map it back to the location

 

Screenshot 2024-05-23 at 2.13.05 PM 2.png

 

I have used the following code in an attempt to join Location and Assets (firstly):

ClearCollect(SiteData, Filter(Locations, Title in ( ForAll(Assets, Site) ) ) );

However i get the following error: 
'Invalid schema, expected a one-column table.'

I have tried different columns, used other collections etc, but can't get this to work. 

 

The end result would be for this one, A user is presented a gallery with the Locations and they can click on that Location, and in another gallery (if this is the best option) would then display the joined data that I would like to present.

 

Making one very large List is an option but not ideal as there are other lists that i want to join as well for different purposes, and this would follow the same process (i assume). 

 

Any help would be greatly appreciated. 

 

 

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @sglund14 - some comments.

     

    You can leverage Collections to merge multiple lists together into a single list, but this will have an adverse impact on app performance because all rows will be loaded into memory during the app session.

     

    It would be performant to "relate" multiple lists together using a common identifier you can guarantee will be unique. In your scenario, this would be the Site ID.

     

    Using the Location and Asset table as a basic example. I can see from the diagram that the relationship cardinality here is Many-To-One from the Location table (Many) to the Assets table (One).

     

    For this scenario I would create two Gallery controls. Gallery1 is linked to Location, and Gallery2 is linked to Assets.

     

    We can use the delegable Filter on Gallery1 to display only items associated to the selected Asset from Gallery2 using something along the lines of:

     

    Filter(
     Location,
     SiteId = GalleryAssets.Selected.SiteID
    )

     

    If you want both Gallery controls to be able to filter in a cross-directional way, you will need to apply the same logic to the Assets Gallery, but also reset both Galleries in order to run the filters again.

     

    Many-to-many relationships

     

    I can see you also have a Many-to-Many relationship between the Assets table and the Providers table, as well as a Many-to-Many relationship from the Location table to the Providers table. 

     

    For Many-to-Many relationships, it is important to emphasise that SharePoint is not a relational database. A data source like Dataverse natively supports Many-to-Many relationships with an "intersect" table which is automatically provisioned in the background to manage those relationships, but SharePoint does not.

     

    You will need to create your own "intersect" or "bridge" table per the number of related tables you have. Based on your diagram, you will need four Lists.

     

    List 1 will record the relationships between the Locations table to Hardware, Assets and Providers
    List 2 will cover the relationships between the Assets table to Locations, Hardware, Assets, and Providers

     

    ....and so on.

     

    As you have probably gathered, it is memory intensive if you try to build many-to-many relationships across multiple tables because SharePoint is simply not designed for this. Even for a simple delegable operation like a Filter, Power Apps will send a query to SharePoint to get all the items that match that query for each table. This will throttle your data source because it is firing a query at multiple tables. You will end up with a 429 error which looks like this:

     

    Amik_0-1716514654927.jpeg

     

    https://learn.microsoft.com/en-us/azure/logic-apps/handle-throttling-problems-429-errors?tabs=consumption

     

    I have created a performant solution like this for my organisation, and two key lessons I learned were to ensure:

     

    • Only delegable functions are used
    • Only display a maximum of two tables/Galleries on the same screen, and then display other table relationships on different screens.
  • sglund14 Profile Picture
    5 on at

    Hi @Amik 

     

    Thanks for the explanation there. The data diagram isn't 100% accurate and was quickly thrown together to help in my explaination but you have definitely helped me there as well. 

    This in fact worked your solution - I had to change the lookup column by adding a column and converting to text, but that was easy enough to work around. 

    Much appreciated.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard