Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Create a new document library and populate it with folders in a single flow?

(1) ShareShare
ReportReport
Posted on by 18
Hi,
 
I am trying to create a Flow that will create a document library then add a number of folders to it.  I can do this using two flows but I wanted to streamline this to a single flow.  The issue I am hitting is I can't create a folder in the newly created document library because it doesn't exist yet, hence I get this error:
 
 
Is there a way I can get around this? Can I call another flow maybe, if so how would I pull in parameter from the previous flow?  Or is there a better way to do this?
 
Thanks
  • RobC-CTL Profile Picture
    18 on at
    Create a new document library and populate it with folders in a single flow?
    Nived - genius! - thanks!
  • Suggested answer
    Nived_Nambiar Profile Picture
    17,722 Super User 2025 Season 1 on at
    Create a new document library and populate it with folders in a single flow?
    Hi,
     
    Try like below
     
    Expression - 
    body('Send_an_HTTP_request_to_SharePoint')?['d']?['Id']
     
     
    Here the send http request creates the document library and second create folder action creates the folder on that created document library using its id with above expression to capture id of document library created.
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!
  • Suggested answer
    AnthonyAmador Profile Picture
    2,553 Super User 2025 Season 1 on at
    Create a new document library and populate it with folders in a single flow?
    Hi, 
     
    Unfortunately, this is not possible using the name of the List or Library. You normally see the names of the libraries in the drop-down option, but in the backend, that is an entity ID. If you can find a way to extract the ID of that new library and enter it as a custom value, it might work.




     
    Hope this helps. 
    Anthony. 
     
    If my reply answers your question, please like and mark it as verified. This helps me stay motivated to assist others and makes it easier for users with similar questions to find the answer. Thanks!
    Feel free to connect with me on LinkedIn!

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >