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 Document Li...
Power Automate
Suggested Answer

SharePoint Document Library

(1) ShareShare
ReportReport
Posted on by 15
Hello All,
 
Let me outline my flow for understanding.  I have created a SharePoint site on our company internal website for employees to access.  On the site the employee can submit a Microsoft Form for access to one of our systems.  This form has the ability to attach documents to certain questions.  These attachments are being saved to my personal work One Drive account.  I have set up a Power Automate that when a Form is submitted it sends all information to a List for tracking and auditing purposes.  Within the SharePoint site there is a document library set up to store all submitted Form attachments.  I am trying to incorporate into the Power Automate that when an attachment document is sent to my One Drive for Business personal One Drive that it will automatically save a copy to the SharePoint Document library AND the link on the List, when clicked on, it will take you to the Document Library and not my One Drive account.
 
Do I need to create a separate flow to automate this?  I cannot figure out how to write this automation and get it to work.  HELP!!!
Categories:
  • AnthonyAmador Profile Picture
    2,557 Moderator on at
    Hi,

    Without seeing your current flow, it’s difficult to give you advice on what to change. However, from what I understand, you just need to add a set of actions below your action to save the file in OneDrive. For example, you could add the “Create File” action from the SharePoint connector.

    Please share screenshots of your flow to help us better understand and assist you.

    Anthony.
  • Suggested answer
    David_MA Profile Picture
    15,536 Super User 2026 Season 2 on at
    Microsoft Forms saves attachments in the OneDrive of the owner of the form. That is normal. To copy the files to a SharePoint document library is relatively easy once you know how of course. Here is a section from one of my flows that does this:
     
    • When you create the flow, you will use the trigger When a new response is submitted followed by the action Get response details using the ID from the trigger.
    • Next, you need to check to make sure attachments were included. To do that, add a condition as illustrated above with the expression length(outputs('Get_response_details')?['your-form-question-with-the-attachment'])
    • For the content of the Parse JSON action, use the question that contains the attachments.
    • For the scheme, use the code below.
    • Add an Apply to each action and set the output to the Body of the Parse JSON action.
    • I had trouble with some form responses where some people were able to upload a 0-byte file, which caused the flow to fail. Add a condition to check that the size of the file is greater than 0.
    • On the yes side, use the Get file content from OneDrive for Business. For the File property, choose the id value from the Parse JSON action.
    • Replace my Add attachment action with a Create file action and point it to the SharePoint document library where you want to save the file.
    • For the filename, use the name from the Parse JSON action and for the file content use the Body of the Get file content action.
    • To get the link to the file that is created, follow the Create file action with a Get file properties action and set it to the id of the file created in the Create file action.
    • {
          "type": "array",
          "items": {
              "type": "object",
              "properties": {
                  "name": {
                      "type": "string"
                  },
                  "link": {
                      "type": "string"
                  },
                  "id": {
                      "type": "string"
                  },
                  "type": {},
                  "size": {
                      "type": "integer"
                  },
                  "referenceId": {
                      "type": "string"
                  },
                  "driveId": {
                      "type": "string"
                  },
                  "status": {
                      "type": "integer"
                  },
                  "uploadSessionUrl": {}
              },
              "required": [
                  "name",
                  "link",
                  "id",
                  "type",
                  "size",
                  "referenceId",
                  "driveId",
                  "status",
                  "uploadSessionUrl"
              ]
          }
      }
       

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 275 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 235

#3
David_MA Profile Picture

David_MA 178 Super User 2026 Season 2

Last 30 days Overall leaderboard