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 / Automating form respon...
Power Automate
Suggested Answer

Automating form response to folder

(2) ShareShare
ReportReport
Posted on by 26
 
Once a form is submitted, I would like the file to be automatically put into a folder with the same name as the file so it looks like below:  (I manually built what I want it to look like)
 
 
Then, inside of that folder, I would like another folder automatically created with the name "PDF Archive so it looks like below:
 
 
I have tried this many different ways with no success.  
Can anyone help me?
 
 
Categories:
I have the same question (0)
  • Haque Profile Picture
    3,653 on at
    Hi @EC-14041929-0,
     
    Do you need to do anything (like copy one file) in the "PDF Archive" folder or just creating the folder suffice?
     
    As your trigger is form submitted, we can follow the steps:
     
    1. Trigger: Use the form submission trigger (e.g., "When a new response is submitted").
    Trigger Choice:
    1. "When a new response is submitted" (Microsoft Forms connector)
    2. "When an item is created" (SharePoint connector – list)
    3. "When an item is created or modified" (SharePoint connector - list) if you want to consider both creation and modification of SharePoint list
    2. Get file details: Retrieve the file or response details including the file name.
     
    Action Choices:
    A. Get file metadata (SharePoint connector) - if you want to get detailed metadata about a file. This action retrieves metadata like file name, path, size, created/modified dates, and more, based on the file identifier or path.
    Get file content (SharePoint connector) - if you want to get the actual file content (the binary data) to use it later (e.g., to copy, attach, or process the file),

    Note: if you want, you can store the file name from the Get file metadata action in a variable to use later to create the folder name.
     
    3. Create folder with file name: We can use the Create new folder action in your storage system (SharePoint, OneDrive, etc.) to create a folder named exactly as the file name.
    Note: when you set the folder path, make sure you put the file name (that you stored in a variable earlier. For example, Folder1/filename – where filename variable is the file name of your submitted
     
    4. Move or save/create the file into that folder: As soon as folder is created with the file name you copy the file to the created folder. User Create file action for the same:

    Note: For the File Name, you can use that variable or use from metadata from step-2. For File Content- use data from step-2.
     
    5. Create "PDF Archive" folder inside: Use another Create folder action to create a subfolder named "PDF Archive" inside the folder you just created.

    Note: when you set the folder path, make sure you put the file name (that you stored in a variable earlier. For example, Folder1/filename – where filename variable is the file name of your submitted. And then append the “/PDF Archive”. This will finally show like Folder1/filename/PDF Archive.
     
    You can make youre choice of triggers based on the scenarion below (for step-1)
     
     
  • Suggested answer
    rezarizvii Profile Picture
    352 on at
    Hi @EC-14041929-0, hope you are doing well.
     
    Here is a general screenshot of what the flow should look like. I have used an instant trigger with a "File content" input to simulate a file being received from a form. You can use your original trigger, just make sure it exposes the File Content and the File Name.
     
    Here are the steps on how you can achieve this:
    1. Use the "Create new folder" SharePoint action to create a folder with the same name as the file:
    Parameters:
    • Site Address: Choose your site from the dropdown.
    • List or Library: Choose the target document library.
    • Folder Path: Enter the full path of where you want the folder to be and then add "/<File-name-received-in-form>" to create a folder with the file name. In your case, assuming Project Source Files is the name of your document library, it should be: Open to Display Source Files/<file-name-as-dynamic-content>
     
    2. Use a "Create file" SharePoint action to create that file in the target folder.
    Parameters:
    • Site Address: Same as last action
    • Folder Path: Use dynamic content and choose Full Path from your previous action
    • File Name: Dynamic content, file name received from your trigger.
    • File Content: Dynamic content, file content received, exposed in your trigger.
     
    3. Use another "Create new folder" SharePoint action to create the PDF Archive folder.
    Parameters:
    • Site Address: The same as the first action.
    • List or Library: The same as the first action.
    • Folder Path: Choose the same path as the first action and then append "/PDF Archive" in front of it. In your case, it would be: Open to Display Source Files/<file-name-as-dynamic-content>/PDF Archive
     
     
    This setup would create the folder with the same name as the file, put the file in that folder, and then create another PDF Archive folder at that location.
     
    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item.
    If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like! 🩷
    _______________________________
    Reza M. Rizvi
    Reza M. Rizvi
    LinkedIn  |  Email
  • Vish WR Profile Picture
    3,748 on at
     
  • Suggested answer
    Vish WR Profile Picture
    3,748 on at
     
    I have completed the working flow and its working ,
     
    I am not sure how i can share with you .
     
     
    Here is the high-level flow 
     
    # 🚀 Power Automate Flow — Forms File Upload → Folder → File (FINAL WORKING)
    ## 📌 Overview
    This flow:
    - Triggers on Microsoft Forms submission
    - Extracts uploaded file metadata
    - Retrieves file content (OneDrive backend)
    - Checks if folder exists
    - Creates folder if not
    - Uploads file into correct folder (no parent issue)
    ---
    # 🔧 FULL FLOW (COPY AS-IS)
    ## 1. whenFormSubmitted
    Type: Microsoft Forms Trigger  
    Action: When a new response is submitted  
    ---
    ## 2. getResponseDetails
    Type: Microsoft Forms → Get response details  
    - Form ID: same as trigger  
    - Response ID: dynamic  
    ---
    ## 3. getFileUploadRaw
    Type: Compose  
    Expression:
    outputs('getResponseDetails')?['body/<your_file_question_id>']
    ---
    ## 4. parseFileJson
    Type: Parse JSON  
    Content:
    outputs('getFileUploadRaw')
    Schema:
    {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "link": { "type": "string" },
          "id": { "type": "string" }
        }
      }
    }
    ---
    ## 5. getFolderName
    Type: Compose  
    Expression:
    trim(split(first(body('parseFileJson'))?['name'], '_')[0])
    ---
    ## 6. getFileName
    Type: Compose  
    Expression:
    first(body('parseFileJson'))?['name']
    ---
    ## 7. getFileId
    Type: Compose  
    Expression:
    first(body('parseFileJson'))?['id']
    ---
    ## 8. Get file content
    Type: OneDrive for Business → Get file content  
    File Identifier:
    outputs('getFileId')
    ---
    # 📁 FOLDER HANDLING
    ## 9. checkFolderExists
    Type: SharePoint → Get folder metadata using path  
    Site Address:
    https://devtenan4-my.sharepoint.com/personal/info_v_com
    Folder Path:
    concat(
      '/Documents/Apps/Microsoft Forms/Post-event feedback survey/Question/',
      outputs('getFolderName')
    )
    Expected:
    - 404 → folder NOT exists (this is OK)
    - success → folder exists
    ---
    ## 10. Create new folder
    Type: SharePoint → Create new folder  
    Site Address:
    https://devtenant24-my.sharepoint.com/personal/info_vish_com
    Library:
    Documents
    Folder Path (parent):
    /Documents/Apps/Microsoft Forms/Post-event feedback survey/Question
    Folder Name:
    outputs('getFolderName')
    Run After:
    checkFolderExists → has failed
    ---
    ## 11. Delay
    Type: Delay  
    Value:
    PT30S
    ---
    # 📄 FILE CREATION
    ## 12. Create file
    Type: SharePoint → Create file  
    Site Address:
    https://devtenant24-my.sharepoint.com/personal/info_v_com
    Folder Path:
    concat(
      '/Documents/Apps/Microsoft Forms/Post-event feedback survey/Question/',
      outputs('getFolderName')
    )
    File Name:
    outputs('getFileName')
    File Content:
    SELECT → "File Content" from Get file content (dynamic)
    ⚠️ IMPORTANT:
    - DO NOT use Body
    - DO NOT pass file name as content
    - MUST use dynamic "File Content"
    ---
    # 🔁 FINAL FLOW ORDER
    whenFormSubmitted
    → getResponseDetails
    → getFileUploadRaw
    → parseFileJson
    → getFolderName
    → getFileName
    → getFileId
    → Get file content
    → checkFolderExists (404 expected)
    → Create new folder (if needed)
    → Delay (30s)
    → Create file
    ---
    # 🔥 CRITICAL RULES
    ✔ Always use "/Documents/..." in SharePoint  
    ✔ Never use "/Apps/..." directly  
    ✔ Folder Path must include folder name  
    ✔ File Content must be binary (dynamic output)  
    ✔ 404 in checkFolderExists = expected behavior  
    ---
    # ✅ FINAL RESULT
    - Folder auto-created per submission
    - File uploaded inside correct folder
    - No parent folder issue
    - No empty file issue
    - Fully stable flow 🚀
     
     
     
     
      Vishnu WR
     
    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like 
     
     
     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard