Your Microsoft Technology Development and Consulting Experts - Operating since 2000
While SharePoint lists aren't technically relational databases, with the right approach, you can implement parent-child relationships and create connected data structures that work remarkably well in Power Apps. This capability lets you build more sophisticated apps without needing SQL Server or Dataverse licenses.
In this guide, I'll show you how to structure, connect, and manage related data across SharePoint lists. We'll build a simple but practical example: an issue tracking system where each issue can have multiple related actions.
Head over to my YouTube channel Chino Does Stuff to watch the video tutorial, there you will see a variety of videos with loads of tricks and tips on the entire Power Platform suite.
To create relationships between SharePoint lists, we'll use a classic database technique: adding a foreign key column that references the primary key of another table. In SharePoint terms:
This creates a one-to-many relationship, where one record in the parent list can relate to many records in the child list.
We'll start by creating two SharePoint lists to store our data:
Here's how to structure each list:
The key to our implementation is the IssueId column in the Actions list. This number column will store the ID of the related issue, creating our parent-child relationship.
SharePoint automatically creates an ID column for every list:
Now, let's create a Power App and connect it to our SharePoint lists:
After connecting, you'll have access to both the Issues and Actions lists within your app, including all their columns.
Our app will need several screens:
For the main screen, create a gallery connected to the Issues list. Add a plus button to navigate to the New Issue screen, and an edit icon in each item to navigate to the View Issue screen.
On your main screen:
The Issue detail screen is where the parent-child relationship becomes visible. This screen should show:
The key is filtering the Actions gallery to show only Actions related to the current Issue:
This filter checks the IssueId column in the Actions list and only shows records where it matches the ID of the currently selected Issue.
When creating a new Action, we need to save both the Action details and its relationship to the parent Issue:
This Patch function saves a new record to the Actions list and sets the IssueId field to the ID of the currently selected Issue, creating the relationship between them.
When working with SharePoint lists in Power Apps, delegation is an important concept to understand. Delegation determines whether operations happen at the data source or in the app.
The good news is that filtering by ID and IssueId (both number fields) is fully delegable to SharePoint, meaning SharePoint will handle the filtering server-side. This ensures you'll get correct results even with large lists.
For best performance:
You can extend this pattern to create deeper relationships. For example, you could add a Comments list related to Actions, where each Action can have multiple Comments.
To implement this, you would:
Unlike true relational databases, SharePoint doesn't support automatic cascading deletes. If you delete a parent record, the related child records will remain orphaned.
If cascading deletes are important for your app, you'll need to implement them manually:
This pattern can be applied to many real-world scenarios:
The pattern remains the same: create a column in the child list that references the ID of the parent record, then use filtering in Power Apps to show only the related records.
While this approach works well for many scenarios, it does have some limitations compared to true relational databases:
For complex enterprise applications with many relationships and large data volumes, you might want to consider Dataverse or a SQL Server database instead.
SharePoint lists can indeed be used effectively as a relational database for Power Apps. By creating linked lists with appropriate columns to establish relationships, you can build sophisticated multi-table applications without needing additional licenses or more complex database platforms.
This approach is perfect for departmental apps, team tools, and solutions where simplicity and accessibility are priorities. The ability to create, view, and manage related records gives your users a cohesive experience while leveraging the familiar and accessible SharePoint environment.
With these techniques, you can build powerful, data-driven applications that feel like they're connected to a full relational database, all while staying within the SharePoint and Power Apps ecosystem.
If you'd like to see more Power Apps development tips and techniques, please head over to the YouTube channel and leave a comment there. I actively monitor and respond to all YouTube comments!
Marcello is a lead developer at Powerplatform Experts, an expert in, Computer Science, Power Platform integration and founder of the YouTube channel ChinoDoesStuff. If you have any questions, please feel free to get in contact at via the form below.
Copyright © 2024. Brayalei Pty Ltd T/As Office Experts Group. ABN 32 093 067 737. ACN 093 067 737. All Rights Reserved.