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 Automate / Get data from Sharepoi...
Power Automate
Unanswered

Get data from Sharepoint lists by looping through folder inside another folder

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Friends,

I am new to Power Automate. I am trying to  extract the data from Sharepoint list using Power Automate to SQL. The following is the image of the sharepoint folder and lists inside the folder.

 

AMERS is folder, inside this there is another folder called Atlanta(ATL...). Inside this Atlanta folder i have multiple lists which i want to read and extract to database. Like this i have many folders and lists that i would like to automate using power automate.

UmaPatil2023_0-1677151093472.png

@grantjenkins @Expiscornovus @wskinnermctc @RezaDorrani @fchopo 

 

I have the same question (0)
  • jiwhite Profile Picture
    500 on at

    This article may help you loop through folders dynamically.

    How to find a folder exists (Dynamic) in SharePoin... - Power Platform Community (microsoft.com)

  • grantjenkins Profile Picture
    11,063 Moderator on at

    @UmaPatil2023 Are you trying to loop through the left navigation and only get the lists that appear there? IF so, then this is how I would do it (there might be an easier way).

     

    For this example, I have 4 x lists and the following navigation.

    grantjenkins_0-1677418352227.png

     

    See full flow below. I'll go into each of the actions.

    grantjenkins_2-1677418410222.png

     

    Get AMERS (Send an HTTP request to SharePoint) retrieves the top-level navigation nodes. It uses the following Uri:

    //Uri
    _api/web/navigation/quicklaunch

    grantjenkins_3-1677418582499.png

     

    Filter array extracts out the navigation node with the Title of AMERS. It uses the following expressions:

    //From
    outputs('Get_AMERS')?['body']?['d/results']
    
    //Filter
    item()?['Title']

    grantjenkins_4-1677418693289.png

     

    Get Headers (Send an HTTP request to SharePoint) retrieves the children from the AMERS navigation node using the following Uri:

    //Uri
    _api/Web/Navigation/GetNodeById(@{first(body('Filter_array'))?['Id']})/Children

    grantjenkins_5-1677418793132.png

     

    Apply to each Header iterates over each of the children using the following expression.

    body('Get_Headers')?['d/results']

    grantjenkins_6-1677418865591.png

     

    Get Lists (Send an HTTP request to SharePoint) retrieves the children from each of the Headers using the following Uri. This will give us our List links.

    //Uri
    _api/Web/Navigation/GetNodeById(@{item()?['Id']})/Children

    grantjenkins_7-1677418968258.png

     

    Select gets the Navigation Node Title and the List Name using the following expressions.

    //From
    body('Get_Lists')?['d/results']
    
    //Title
    item()?['Title']
    
    //ListName
    split(item()?['Url'], '/')[4]

    grantjenkins_8-1677419085120.png

     

    Apply to each List iterates over each of the Lists using the output from the Select.

    grantjenkins_9-1677419160253.png

     

    Get items retrieves the items from the current list using the following expression for the List Name.

    item()?['ListName']

    grantjenkins_10-1677419228735.png

     

    Apply to each Item iterates over each of the items in the current list using the output (value) from Get items.

    grantjenkins_11-1677419314654.png

     

    You would perform your data mapping to your SQL table(s) within this loop as per your requirements.


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 233

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 190

Last 30 days Overall leaderboard