0

I have a document library with a main folder and several nested subfolders. I'm trying to create a Power Automate flow that can navigate through these folders to retrieve the names of all the documents within the library.

I used the "Get file (properties only)" action, but it only returns the file names in the compose action, not the actual document names.

I've tried using "For each" loops, "Do until" loops, and the dynamic content "isFolder" with a condition that checks if it is a folder. If true, it uses "Get file (properties only)" again, and once it is false, it prints the document name using a compose action.

I need assistance with my looping logic to achieve the desired outcome. Specifically, I need to bypass all the folder names and extract the names of all the documents.

1 Answer 1

0

You could extract all the file names from a document library including from within nested folders by using Send an HTTP request to SharePoint with the following Uri

_api/Web/Lists/GetByTitle('Your-Library-Title')/Items?$expand=File

Here is a complete flow for your reference

enter image description here

Detail 1

enter image description here

Detail 2

enter image description here

Detail 3

enter image description here

if(equals(length(string(items('Apply_to_each')?['File']?['Name'])),0), 'Folder', items('Apply_to_each')?['File']?['Name'])

1
  • I'll give this a try and get back with you. Thank you in advance.
    – Mile T.
    Commented Jul 2 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.