Skip to main content

Notifications

Community site session details

Community site session details

Session Id : TRbzM5Pt6kyGBNGK/oGG9K
Power Automate - Building Flows
Answered

How to move a file created by a form submission from within sharepoint?

Like (0) ShareShare
ReportReport
Posted on 4 Mar 2024 16:47:06 by 38

My flow is triggered by a form submission, and it involves multiple possible attachments. Currently, I take the attachments from the "Get response details" action, and am provided with this:

{
 "body": [
 {
 "name": "filename.png",
 "link": "https://example.sharepoint.com/sites/directory.png",
 "id": "01MZTSHJDMECTWOGD7C5A32K4NH6TCK53L",
 "type": null,
 "size": 56135,
 "referenceId": "01MZTSHJGSGR3BG2RMZRHY4UG44WC7YGZG",
 "driveId": "b!lpFf3dPwhU6zJNTbpGM6BartDUSBGbFOmvIgFbItjKXPcTH9pHmiSbvaCVVjlkuN",
 "status": 1,
 "uploadSessionUrl": null
 }
 ]
}

 

Since there are multiple questions, I parse them all into one array to iterate over using an Apply to each loop. My goal then, is to do these things:

  1. Move the file from the form submission folder to a destination folder
  2. Grab the link to the file in its new location, so that I can add it to a project board and have it directly connect

I'm struggling to do this, because it seems that the "move file" action requires a file identifier, and that identifier is not one of the things returned by the "Get response details" action. Here is my flow currently:

awaples_0-1709570783077.png

How can I move the file and get its new link from the properties available, as shown above?

  • Verified answer
    awaples Profile Picture
    38 on 18 Mar 2024 at 17:08:32
    Re: How to move a file created by a form submission from within sharepoint?

    So, I ended up figuring out 2 different things that I'll put here for others to reference. 

    1. My solution was to simply just use the File path in the "File To Move" box for the SharePoint "Move File" action. Since I know the name of the question in the form, I know the name of the folder the file is stored under when a form response is submitted, so by using the name of the question and the name of the file submitted, I can directly access the file to move it. Here is my flow for this setup, the apply to each loops are for if there are multiple files submitted, and the "Parse attachments JSON" action combines all of the attached files into 1 single JSON to iterate over so I can move them all. awaples_0-1710781667398.png
    2. If you want to get the "ItemID" value of a file using its path, simply use the SharePoint "Get file metadata using path" action, which I was previously unaware existed. This will directly return the files "ItemID" value, something that is used in a lot of other actions.
  • creativeopinion Profile Picture
    10,419 Super User 2025 Season 1 on 05 Mar 2024 at 22:25:22
    Re: How to move a file created by a form submission from within sharepoint?

    @awaples You might find my latest YT Tutorial helpful: How to Get Microsoft Form File Uploads Attached to an Email 📧

     

    Although this tutorial specifically covers how to get the File Uploads from a Group Form (where the files are saved in SharePoint and not OneDrive) attached to an email—you should be able to use the same logic to move your files to a different folder.

     

     Two types of MS Forms

     Where Microsoft Personal (OneDrive) Form File Uploads are Saved

     Where Microsoft Group Form File Uploads are Saved

     How to Add a File Upload Question to an MS Form

     How to get a Microsoft Form ID

     How to get a Microsoft Form Response

     How to Get the Dynamic Content Microsoft Form File Upload Content

     How to handle Single and Multiple Microsoft Form File Uploads

     How to use a Scope action to Organize and Group Your Flow Actions

     How to Get the File Content from an MS Form File Upload

     How to Collect All Files Uploaded to a MS Form and Attach to an Email

     How to Handle MS Form Response When a File Isn’t Uploaded

     How to Create an Email Key

     How to Send an Email to a Specific Recipient Based on Form Selection

     How to Create a Dynamic Output Based on Form Selection

     

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response! If you're feeling generous— ️  Buy me a coffee: https://www.buymeacoffee.com/acreativeopinion

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok
  • awaples Profile Picture
    38 on 05 Mar 2024 at 22:09:52
    Re: How to move a file created by a form submission from within sharepoint?

    Unless I am misunderstanding something, the link in the response object is a sharepoint link, not a onedrive link, and to access the form responses, I have to go to the Forms folder in my companies sharepoint, NOT my onedrive. My onedrive doesn't even have a forms folder. This makes sense since the form being used is owned by the company, not me.

  • Nived_Nambiar Profile Picture
    17,639 Super User 2025 Season 1 on 05 Mar 2024 at 16:50:20
    Re: How to move a file created by a form submission from within sharepoint?

    Hi @awaples 

     

    Have you confirmed that by checking the file link in response object ?

     

    https://techcommunity.microsoft.com/t5/microsoft-forms/tutorial-where-are-ms-form-attachments-stored-explained/m-p/3950572

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • awaples Profile Picture
    38 on 04 Mar 2024 at 19:17:10
    Re: How to move a file created by a form submission from within sharepoint?

    They are not stored in onedrive, the form is a group form and they are stored in the sharepoint. Hopefully that would make it easier I'd imagine? Regardless, this method wont work due to that.

  • Nived_Nambiar Profile Picture
    17,639 Super User 2025 Season 1 on 04 Mar 2024 at 17:15:03
    Re: How to move a file created by a form submission from within sharepoint?

    Hi @awaples 

     

    The files uploaded to form are seemed to be stored in onedrive , so to move to sharepoint , use get file content to get file content of file from onedrive and then create file using that file content in sharepoint.

    Nived_Nambiar_0-1709572438692.png

     

    Nived_Nambiar_1-1709572458243.png

     

    i used delete file at last so to simulate like move operation.  As move = create file at destination + delete file at source

     

    Hope it helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

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

Announcing the Engage with the Community forum!

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Automate - Building Flows

#1
David_MA Profile Picture

David_MA 292 Super User 2025 Season 1

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 259 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 214

Overall leaderboard
Loading started