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 / Working with files fro...
Power Automate
Answered

Working with files from the Forms "File Upload" question type

(1) ShareShare
ReportReport
Posted on by 1,393

I was very excited to learn that the "File Upload" question was coming to MS Forms. We have a LOT of scenarios where we want to collect files from people in a way that also collects some metadata, so this will be very useful. However, I'm having a bit of trouble accessing those files from Power Automate.

 

So, I have a form that will be used to collect Syllabus files from faculty. They'll need to enter some course info which will be used as metadata on the uploaded file. The form automatically puts the file into a folder named after the form, several layers down in the Documents library (which I'm not thrilled about, but whatever). What I want to do is move that file to a separate document library with columns to accept the metadata. 

 

The Get Form Response action returns the file upload question response in a block that, I guess, needs to be parsed out? This is what it provides:

"r9e51ca9ff4b8420e9dd54ab305d36805": "[{\"name\":\"<file_name>.pdf\",\"link\":\"https://<tenant>.sharepoint.com/sites/<site_name>/Shared%20Documents/Apps/Microsoft%20Forms/<form_name>/Question/<file_name>.pdf\",\"id\":\"01H7BFDJ7AEHYC2NLCRJGK5UT5FNKG2ID4\",\"type\":null,\"size\":41382,\"referenceId\":\"01H7BFDJZUQGHQ4UHE6ZHLCOFMB5D24YRC\",\"driveId\":\"b!4cQiASLhPUq8SGSD21oPlB3OwJfDzrJMtPR2NlkFKObx4in0iZlARpy7sxn656jT\",\"status\":1,\"uploadSessionUrl\":null}]"
 
What I need is a way to reference the elements within that. Specifically, the "link", which I can then feed into the appropriate SharePoint actions to get that file and move it to/create it in the appropriate library. 
Categories:
I have the same question (0)
  • manuelstgomes Profile Picture
    6,625 on at

    Hi @ChadVKealey 

     

    Can't you use the file that is returned from the form to upload to SharePoint?

    2019-12-16 15_31_30-Create your flow _ Microsoft Power Automate.png

     

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers
    Manuel

  • ChadVKealey Profile Picture
    1,393 on at

    @manuelstgomes , unfortunately, that won't work. I need to figure out (or have someone show me) how to parse out what's returned as the "uploaded file data". It's not JSON, exactly...I'm not sure what it is. But, I'm sure there's a way to pull it apart to get the Path and Display Name values, which are what I need.

  • v-litu-msft Profile Picture
    on at

    Hi @ChadVKealey,

     

    You could find these files in the details of the responses:

    Annotation 2019-12-17 154308.png

     If you want to get its properties apart from the answer, you can use the expression json():

    Annotation 2019-12-17 154716.png

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • ChadVKealey Profile Picture
    1,393 on at

    @v-litu-msft , could you share the expression in the input of the second Compose action? 

  • ChadVKealey Profile Picture
    1,393 on at

    Actually, using the Parse json action, I can get the elements/details of the file, but it looks like "path" and "file identifier" are not among them, at least not in the forms needed by "Get file metadata from path" or "Get file metadata". The "Link" is there, so I suppose it would be possible to extract the path from that, I'm just not very good at writing those kinds of expressions. 

  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @ChadVKealey,

     

    After you get the JSON, please add parse JSON action, then you will get two dynamic content you can using in the following steps - dirveId and id.

    {
     "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"
     ]
     }
    }

    Then you can get the file content by using the Get file content action of OneDrive for Business connector, append the driveId and id into the File ID field, please notice that the dot between them:

    Annotation 2019-12-18 180014.png

    After all, you can create file by the file content.

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • ChadVKealey Profile Picture
    1,393 on at

    Thank you @v-litu-msft ! I'm actually using a Group Form, so the files are going into a SharePoint Document Library, not my OneDrive. I tried using the "Get file metadata" and "Get file content" actions from the SharePoint connector with the driveid.id as the "identifier" and it would fail to locate the file. However, using the actions of the same names from the OneDrive for Business connector, it's able to get the file and its contents. Considering the file is stored in SharePoint, not OneDrive for Business, I'm surprised that the OD4B actions worked. 

     

    This is a potentially huge time-saver for a lot of our departments!

  • Community Power Platform Member Profile Picture
    on at

    @ChadVKealey Sorry I've i've misinterpreted - did you manage to get it working with group forms? 

     

    Struggling with the same issue so any help appreciated!

  • ChadVKealey Profile Picture
    1,393 on at

    @Anonymous , yes, I did get it to work, using the OneDrive for Business actions in Power Automate to get the files from the Documents library in the Group's SharePoint site. See this video for the end-to-end walkthrough of a process I built for academic departments to collect syllabi from faculty: https://youtu.be/fjdhb9_m7Ho (or, jump to https://youtu.be/fjdhb9_m7Ho?t=440 to view just the part about Power Automate). 

     

    I think this could be done using the "get file..." actions in the SharePoint connector, but finding the right combination of action, properties and values could take some trial and error. Considering OneDrive (for Business, anyway) is based on SharePoint, it's kind of frustrating that there are different actions and capabilities from the Power Automate perspective. Some other connectors treat them as equivalents. For example, some of the "Excel (Business)" actions have inputs for the file location and the drop-down shows "OneDrive for Business" and then all of the SharePoint sites/libraries to which the user has access. 

  • Community Power Platform Member Profile Picture
    on at

    @ChadVKealey  thanks for the response & the link. I will try again with the Onedrive for business connection instead as I've spent too long in the trial and error stage of the sharepoint equivalent! Despite all the hope that this post gave me!

    Cheers

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard