What I am trying to accomplish is when a form response is submitted create a sharepoint list item. The issue I am running into is that there is a question to attach files and I am unsure of how to capture that in the sharepoint list. Is this possible? I was thinking of potentially creating a column, that would store a shareable link, since it seems the attachments from the form are being stored in my OneDrive account. Thanks in advanced for any help.
Hi @--EKM, currently you can't add attachments to a form in Microsoft Forms so I'm not sure how you are going to get those attachments.
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
I am not sure when this feature was added but I can confirm that it is currently supported. Please refer to the image below.
Well that's good news , I know they were working on it and so it looks as though it's rolling out although it's not arrived in my tenant yet.
Can you share a sample output of the submitted form in flow? I just want to see what is the type of attachment that is being returned.
If it is a file content in base64 format, you can create an item in flow and then add an action to add an attachment to that item and use the binary function to create the file content for that attachment.
If the file upload question creates a link to the file saved in onedrive, you can create a multiple lines of text column in SP list and save the URL over there.
Hope this Helps!
Hey @yashag2255 ,
I'm not sure how to see how it is saving the file from the outputs. What I tried to do was just create a column to save the "response" of attaching files and it gave me a long link which does contain the link to the file along with a lot of other stuff. This is the output it gave me:
Sorry if thats confusing to read, I tried to exclude any personal information. However, what is highlighted in red does link directly to the uploaded file. How do I get sharepoint only to save what is after "link" and before "id". I think that would solve my issue for one file and if there were any other files to concatenate the outputs. Thanks for any help.
In order to setup your 'Parse JSON' action, you'll first want to grab a sample JSON output from the attachments field in your 'Get response details' action. After generating, you'll be able to reference/use the 'link' from Dynamic content as with other properties.
Check out around the 6 minute mark of this great post/video from Gareth Hunt.
Hope that helps!
Hey All! If you are using a simple form, you can follow this article: https://www.bythedevs.com/post/working-with-files-on-ms-forms-in-ms-power-automate
If using group forms, follow this one: https://www.bythedevs.com/post/working-with-files-on-ms-forms-group-form-in-ms-power-automate
Hope this Helps!
Thanks @yashag2255 for the writeups. I implemented similar condition to check if attachments exist before parsing the JSON. At that point, one can append the body('Parse_JSON')['link'] results to an array variable, and then add that to any 'Send an email' or SharePoint 'Create item' as appropriate.
NOTE: Similar to the original post/question, I only parsed for 'link' as the Group Form attachments will already exist on the target SharePoint site. Added 'Attachments1', 'Attachment2', 'Attachment3' hyperlink columns to the SharePoint list, and then used the following Expression in Power Automate to add the attachment links URLs to the SharePoint list item (if they exist):
Attachment1: if(greater(length(variables('Attachment Links Array')),0),variables('Attachment Links Array'), '')
Attachment2: if(greater(length(variables('Attachment Links Array')),1),variables('Attachment Links Array'), '')
Attachment3: if(greater(length(variables('Attachment Links Array')),2),variables('Attachment Links Array'), '')
Thanks again to @yashag2255 and Gareth Hunt for their contributions.
Check out the new Process Advisor community forum board!
Check out new user group experience and if you are a leader please create your group
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks
Check out how to claim yours today!