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 / List all files in ever...
Power Automate
Answered

List all files in every (sub)folder in One Drive

(0) ShareShare
ReportReport
Posted on by 3
Hi everyone,
 
I am trying to have a SharePoint list that has all the files information in One Drive. I started with manual trigger and list files in root folder. Then I added condition to check if the files in root folder are folders or not. If it is not folder (meaning they are files), then the flow should create items in the SharePoint list. If it is folder, I added another layer of list all files in the folder. I am hoping to have the flow keep checking all layers of subfolders until every file is listed in the SharePoint list. But currently, it only creates items for certain documents, and it won't stop creating the same items. Could anyone help me fix this?
 
Another question is that I am hoping to get a URL that links to the file (which is a field in the SharePoint list), but I also don't know how to do it. Can anyone give me some guidance? 
 
Thank you!
Screenshot 2025-04-17 162242.png
Categories:
I have the same question (0)
  • Verified answer
    WillPage Profile Picture
    2,337 Super User 2026 Season 1 on at
    The OneDrive List files action makes you specify a folder (or list the files in the root folder). This is very annoying when you want to list all the files in OneDrive regardless of the folder.
     
    Thankfully, OneDrive is just a SharePoint site that only you have access to, so you can actually just use the SharePoint connector's Get files (properties only).
     
    You must manually enter a custom value for the site and library. The site is https://domain-my.sharepoint.com/personal/firstname_lastname_domain_com where domain is your company domain and all the dots and @ symbol in your UPN/ email address are replaced by underscores.

    You need to type out Documents in the library name - it won't appear in the pick list after you put the custom site address in. 

    If you have a lot of items in there, be sure to go into settings via the 3 dots top right and set the pagination to 5000.

    The response contains all files and folders, along with a {Path} property which indicates which folder it's in and {IsFolder} boolean to indicate whether it's a folder or not. 
     

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 840

#2
Valantis Profile Picture

Valantis 661

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard