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:
Solved! Go to Solution.
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:
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.
Hi @ChadVKealey
Can't you use the file that is returned from the form to upload to SharePoint?
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
@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.
Hi @ChadVKealey,
You could find these files in the details of the responses:
If you want to get its properties apart from the answer, you can use the expression json():
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.
@v-litu-msft , could you share the expression in the input of the second Compose action?
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.
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:
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.
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!
@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!
@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.
@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
Hello, i have the Problem, that i woult become Files from the Forms Upload to my Planner, and i think, this here can be my solution, but i don't understand what i have here to do
What Code must in the "outputs(...) ?
Thank you
This video should help: https://youtu.be/wg5xzN2TEok
The difference with planner "attachments" is that the files are not actually attached to the tasks in the same way that files would be attached to an email or SharePoint list item. The task stores links to the files. If it's a group form, they would be stored in the SharePoint site of the group. If the plan is connected to the same group, you can just add the links. If it's a personal form, or the form and plan are NOT connected to the same group, then you need to either create an appropriate sharing link to the file, or copy it to the site connected to the plan.
User | Count |
---|---|
88 | |
40 | |
23 | |
20 | |
16 |
User | Count |
---|---|
128 | |
50 | |
47 | |
35 | |
25 |