web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create sharepoint fold...
Power Automate
Unanswered

Create sharepoint folder structure with power automate

(1) ShareShare
ReportReport
Posted on by 28

In part of my flow, I am creating a Parent Folder that will live inside of an existing SharePoint Document library folder.  I am then adding several sub-folders to this folder and finally moving a newly created word doc into the Parent Folder.  What I am having an issue with is getting the subfolders created in the actual Parent Folder I am creating,  Instead it is creating a new Shared Documents folder in my library and then creating the folder structure inside of that.  See images and flow snippets.

 

Existing Document Folders

Existing Folders.PNG

 

Flow Step Creating Parent Folder

Create Parent.PNG

 

Flow Step capturing folder path of the Parent Folder into Variable

Save Parent Path.PNG

 

Flow Step Creating one of the subfolders

Create Subfolder.PNG

Flow Step moving word doc into parent folder

Move Word Doc to Parent Folder.PNG

 

Document library showing that the parent folder was created in the correct place and the word was moved there just fine

Word Doc Moves Fine.PNG

 

HOWEVER for the sub folders, they are getting created outside of the Documents/Approved BAU Requests and another Shared Documents folder is being created, this is the part I am struggling with.  I just want these sub folder in the folder shown above!

 

Why are the subs here.PNG

 

How the Documents folder looks after the flow runs, again, do not want this extra Shared Documents folder here

Bad Shared Doc Folder.PNG

 

 

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Lday75,

     

    The full path property also contains the name of the document library. In this case that would be 'Shared Documents/Approved BAU Requests/BAU RequestID - P98005'. 

     

    A workaround could be to trim the Shared Documents/ part of that full path property.

     

    Below is an example of expression which can do that:

    replace(outputs('Create_new_folder')?['body/{FullPath}'], 'Shared Documents/', '') 

     

    fullpathproperty.png

     

    Btw, for the file move you probably will need the full path. So I would suggest to use a different variable for that one or directly use the full path property as dynamic content in the destination folder field.

  • Lday75 Profile Picture
    28 on at

    Thank you Expiscornovus.  I used the formula for the replace expression, see below, however I am now getting an error as shown below the expression screen shot.  I am VERY new to using expressions in PA, so please let me know where I missed something.  Thanks Again

     

    Expression

    expression.PNGerror.PNG

  • Verified answer
    Lday75 Profile Picture
    28 on at

    I found the error, had to replace Create_new_folder with Create_Parent_Folder and that did it.  Thanks again Expiscornovus for your input and resolution for this!

  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Lday75,

     

    Small typo, sorry! 😁

     

    The name of the action has be the same in the expression. Glad you found the root cause of the error yourself. 

  • Zoja2021 Profile Picture
    2 on at

    Hi, 

    If possible please send me a screenshot of the entire flow as I have a similar problem but need to create a folder in an already existing folder in the Library?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard