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 / Variable as Folder Path
Power Automate
Unanswered

Variable as Folder Path

(0) ShareShare
ReportReport
Posted on by 2

Basically I have a lot of units in a project I am working on and want to create a SharePoint folder for each one named after each project. The Path argument of "create new SharePoint folder" doesn't seem to recognize variables as dynamic arguments so I've tried passing the data in through a .json file and the compose action but my flow keeps getting stuck in the apply to each function at the end.

Running the program without the create folder action shows that the values  I want to use to name the folders as are coming out of Compose 3 just fine. So it's something with the create folder hanging everything up.

 

Is it possible to pass in a variable as the the Path argument when creating a new SharePoint folder? Or is there a reason I'm missing as to why the apply to each is getting stuck?

Capture.PNG
Capture1.PNG
Categories:
I have the same question (0)
  • David_MA Profile Picture
    14,056 Super User 2026 Season 1 on at

    Since you don't show what you are actually composing in the Compose actions, it is hard to tell what the problem may be. However, this has worked for me without any issues:

    folderpath.jpg

    In the Create file action, select the root level folder where you want the subfolders created. Then be sure that your variable data path begins with a backslash as shown above in the Compose Folder Name action. Don't confuse it with the Compose Folder Path action. That one creates the link to the folder that I use in an e-mail action later on. 

     

    My naming convention is the current year and the ID of a forms submission padded with zeros. It results in folders named like:

    David_MA_0-1689960445359.png

     

  • jsbmk Profile Picture
    2 on at

    Oops. Here's what I have currently:

     

    Compose 1: base64(outputs('Get_file_content_using_path')?['body'])
    Compose 2: base64ToString(outputs('Compose'))
     
    The first two composes are used to get the json data from my file. The data is then parsed into the format: 
    [
      {
        "UnitNumbers""Fxxxxxx1 "
      },
      {
        "UnitNumbers""Fxxxxxx2 "
      },
      ...
      ]
     
    Then attached is what I have inside the apply to each loop
    Capture2.PNG
  • David_MA Profile Picture
    14,056 Super User 2026 Season 1 on at

    What you are generating cannot be used as a folder path. It contains invalid characters and line returns that are not allowed. A folder path would be something like.

     

    /documents/expenses/reports

  • S-Venkadesh Profile Picture
    1,214 Super User 2026 Season 1 on at

    Hi @jsbmk ,
    I have replicated the issue you mentioned and here are the steps and details of what worked for me:

    SVenkadesh_0-1690062287262.png

    I hope this information is helpful. If it is, please consider giving a thumbs up.

     

    Best regards,

    Venkadesh Sundaramurthy

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard