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 / SharePoint getting fol...
Power Automate
Suggested Answer

SharePoint getting folder contents and sending them elsewhere eluding me

(0) ShareShare
ReportReport
Posted on by 2
Hello all,
 
I am so grateful for all of you in the community, I think of myself as a decently advanced user of Power Automate, largely due to a lot of things I have read here. But I have a project that is eluding me. Broad details I have somebody that is responsible for uploading data into folders in my SharePoint but the folders are dynamic, so there would be files in a folder for a date 11-4, 11-5, 11-6, etc and each folder would have several files in them. I need a power flow that gets the files from the folder when the folder is created, and then send them somewhere else, in this case it is going to use the SFTP-SSH connection, but that part is relatively irrelevant.
 
The issue I am having is I cannot think of a trigger that would allow for a dynamic folder path, particularly because they aren't the main folders in the library (For example it goes Documents/Client/Facility/Date/ then get the files from said folder to perform the next action.
 
Thank you for any help you can provide!
Categories:
I have the same question (0)
  • Suggested answer
    Ellis Karim Profile Picture
    12,040 Super User 2026 Season 1 on at
    Here's something you can try:
     
    1. Start with the trigger When a file is created (properties only) as shown:
     
     
    2. Add two trigger conditions.
    • One trigger condition to only trigger the flow if a folder was created
    • Another condition to trigger the flow if folder path starts with 'Shared Documents/Client/Facility/'


    @triggerOutputs()?['body/{IsFolder}']
    @startsWith(triggerOutputs()?['body/{FullPath}'],'Shared Documents/Client/Facility/')
    Note that in the @startsWith() you must use to the correct name of 'Shared Documents'

    You would need to wait to ensure that all the data files have been written to the folder before sending them using SFTP-SSH.

    Finally, you could add another trigger condition to check if the folder that was just created was created ONLY under 'Shared Documents/Client/Facility/' (i.e. at a folder depth of 4) and not for example 'Shared Documents/Client/Facility/11-04/Folder1'.

    @equals(length(split(triggerOutputs()?['body/{FullPath}'],'/')),4)






    The data (properties) in the Body of the triggerOutputs that we are interested in will look something like this:

    "{IsFolder}": true
    "{FullPath}": "Shared Documents/Client/Facility/11-4"


    Ellis
     
  • MV-04112139-0 Profile Picture
    2 on at
    Thank you for the response! I got the trigger working, how would I get the files within that folder. I was thinking a "For each" but I can't seem to drill into that folder despite doing something like this. It sees the folder, but I cannot seem to get the files out of us.


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 Automate

#1
Vish WR Profile Picture

Vish WR 484

#2
Valantis Profile Picture

Valantis 477

#3
Haque Profile Picture

Haque 456

Last 30 days Overall leaderboard