Parent-Child List Setups in Power Apps or Power Automate

Working with parent-child relationships in Power Apps or Power Automate is a common scenario, especially when dealing with related data stored in SharePoint lists or other data sources. This tutorial will guide you through a simple and effective way to reference a parent-child list setup, allowing you to streamline your data management processes.

Let’s keep this straightforward. Imagine you have two SharePoint lists: one for Requests and another for Approver Tasks. The Approver Tasks list is linked to the Requests list through a column called RequestID. When a task is created, the corresponding request’s ID is stored in this RequestID column.

 

Implementing in Power Apps

In Power Apps, you can use a gallery control to display the list of requests and another gallery to show the associated tasks. Here’s how you can set it up:

  1. Gallery 1 – This gallery will display the list of requests.
    • Items property: Set this to Requests (assuming “Requests” is the name of your list).
  2. Gallery 2 – This gallery will show the tasks related to the selected request in Gallery 1.
    • Items property: Use the following filter function:
      Filter('Task List', RequestID = Gallery1.Selected.ID)

This setup ensures that when a user selects a request in Gallery 1, Gallery 2 will dynamically display all tasks linked to that request.

Implementing in Power Automate

In Power Automate, you can achieve a similar result by using the Get Items action to filter tasks based on the RequestID. Here’s a basic outline:

  1. Trigger – Start with a trigger that fits your scenario, such as when an item is created or modified in the Requests list.
  2. Action – Get Items – Use the Get Items action to retrieve tasks from the Approver Tasks list. Apply a filter query to get only the tasks related to the current request:
    Filter Query: RequestID eq '<RequestID>'

    Replace <RequestID> with the dynamic content for the ID of the current request.

  3. Further Actions – You can then use these filtered tasks in your flow, whether for notifications, approvals, or other business processes.

Enhancing the Solution

For more complex scenarios, consider implementing the following enhancements:

  • Delegation: Ensure that your queries are delegable to improve performance, especially with large data sets. In Power Apps, certain functions like Filter might not be delegable depending on your data source, so check and adjust accordingly.
  • Lookups: Instead of using a plain text column for RequestID, you could use a lookup column in SharePoint. This adds an extra layer of data integrity by directly linking the tasks to requests.
  • Custom Connectors: If you’re working with data sources beyond SharePoint, custom connectors in Power Apps and Power Automate can help maintain these relationships across different platforms.

By following these steps, you can efficiently reference and filter parent-child list relationships in both Power Apps and Power Automate. This approach not only simplifies your app or flow design but also enhances user interaction and data accuracy.

Elevate Your Workplace with SharePoint Lists

The Klarinet Solution Delivery Team are accredited digital workplace consultants who specialize in long-term collaborative strategy, business process automation, and custom solutions. To find out more about how we can help you elevate your workplace, get in touch with us today!