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 / Recursive table in a S...
Power Apps
Suggested Answer

Recursive table in a SharePoint List

(0) ShareShare
ReportReport
Posted on by 1,028

Hello everyone,

I have a recursive table in a SharePoint List that contains the following columns:

ID

ParentId

Libelle

(as shown in the screenshot).

 

Now, I want to apply filters to retrieve, for example, only the items whose root parent has ID = 2.

How can this be done?

Thank you.

I have the same question (0)
  • Suggested answer
    Assisted by AI
    wolenberg_ Profile Picture
    1,476 Super User 2026 Season 1 on at
    Hello @gikido,

    You’re working with a hierarchical structure, where each item may have a parent, grandparent, etc. To find all items under ParentalID = 2, you need to trace each item's ancestry up to its top-level parent.
    Unfortunately, Power Apps and SharePoint don’t support true recursion out of the box but you can work around it.
     
    Option 1: Preprocess the hierarchy
    If possible, add a column to your SharePoint list called `ParentalID`, and populate it manually or via Power Automate. This column would store the top-level parent ID for each item. Then you can easily filter like:
    Filter(YourList, ParentalID = 2)
    
     
    Option 2: Use nested collections in Power Apps
    If you can’t modify the list, you can build a recursive lookup in Power Apps using `With()` and `LookUp()` to trace each item's lineage. For example:
    With(
        { rootItem: LookUp(YourList, ID = 2) },
        Filter(
            YourList,
            IsDescendantOf(ID, rootItem.ID)
        )
    )

    You’d need to define `IsDescendantOf()` as a custom function using nested `LookUp()` calls — but this gets complex fast and may hit delegation limits.
     
    Option 3: Use Power Automate
    Create a flow that:
    1. Starts from ParentalID = 2  
    2. Recursively finds all children  
    3. Returns the full list to Power Apps as a collection
    This avoids delegation issues and gives you full control over the hierarchy.
     
     
    Bottom line
    For performance and simplicity, adding a `ParentalID` column is the best long-term solution. If you need help building the Power Automate flow or writing the recursive logic.
  • gikido Profile Picture
    1,028 on at
    Thank you for your reply 
    I found the same solution in ChatGPT, but I would like another suggestion
     
  • wolenberg_ Profile Picture
    1,476 Super User 2026 Season 1 on at
    That suggestion that you pasted, it is working with Collections to extract the filtered information from the list, it's any questions about this method ?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 556

#2
WarrenBelz Profile Picture

WarrenBelz 412 Most Valuable Professional

#3
Haque Profile Picture

Haque 296

Last 30 days Overall leaderboard