MS Forms File Upload to SharePoint

Поделиться
HTML-код
  • Опубликовано: 28 фев 2021
  • How to save a file that's uploaded through a Microsoft Form to a SharePoint site in Microsoft 365. BTW, for the "Schema" in the Parse JSON action/step, you'll want to use this:
    {

    "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"
    ]
    }
    }
  • НаукаНаука

Комментарии • 71

  • @butterflyc72
    @butterflyc72 2 года назад +3

    Finally - I found a video that actually got the outcome I was hoping for, thank you! I have worked on the flow all week trying to get the parsing to work, however - all the other ones didn't say "get file content metadata" - that was the thing, thank you! Now I got the item to also add the attachment to a SP list.

    • @cvkealey
      @cvkealey  2 года назад

      Glad I could help!

  • @jacopoferrariosardi
    @jacopoferrariosardi 2 года назад

    Great video! Thank you so much for making it so clear and understandable. Awsome work.

  • @melonafrancis731
    @melonafrancis731 2 года назад

    Thank You Chad for the great video. I tried it for the group forms and it worked perfectly fine. I was looking for this solution for a group form.

  • @enzym2004
    @enzym2004 Год назад +1

    Great tutorial, thanks! =)

  • @E-TypistIncAdmin
    @E-TypistIncAdmin 3 года назад +2

    I appreciate taking the time to make these videos. Key difference between yours and the ones that become excellent resources - you did not post a copy of the codes that you are using. Please include those on future posts. It saves a lot of time in other instructional videos because you can just say "the code is in the description, you can copy and paste, use as a template, etc." Thanks!

    • @E-TypistIncAdmin
      @E-TypistIncAdmin 3 года назад +1

      Is this what you used?
      {
      "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"
      ]
      }
      }

  • @MOYO-der-Skipper
    @MOYO-der-Skipper 2 года назад

    I am excited. With your help, I managed to implement an "IT HELPDESK" in teams. Thank you very much for this great video.

  • @ashvinsaini01
    @ashvinsaini01 Год назад +1

    Very nice video

  • @rodrigoescobar2825
    @rodrigoescobar2825 2 года назад +1

    Great video! I was wondering how could you obtain a sharing link from that Create a File from the For Each loop. Should it be inside the loop or outside if I want to be able to use the sharing link in a different action further down the flow? I´ve tried both and I can only use the "Current Item" from the loop in a further action or I get an error message. I would appreciate the help. Thanks in advance.

    • @cvkealey
      @cvkealey  2 года назад +1

      The "create sharing link" action would need to be inside the loop. I would suggest storing it in a stringvariable as an href (e.g.: [file-name]). If you have just one file, it's fairly easy. If you have multiple files (in a particular question), you'd have to append to that string variable in a format that makes sense for your scenario. Or, in one project, I created a flow that saved all the files from a particular submission to a folder in SharePoint, then generated a single sharing link for that folder.

  • @iupetre
    @iupetre 2 года назад +1

    Noob question: If you have different files for different questions, would you put the questions in the Parse JSON Content, or would you need to string together multiple Parse JSONs?

    • @cvkealey
      @cvkealey  2 года назад +1

      It depends on your use case and requirements. If all the files are going to the same place, you can append the responses to an array variable and then parse that array. Or, if you need to send different files to different places, you can handle them individually. See this playlist for a more comprehensive and updated look at the various options: Microsoft Forms, Uploaded Files and Power Automate: ruclips.net/p/PLMVyjgrWIGnwQowO2RsvHg0pZ8EozvAG-

  • @user-hl8yp8in9b
    @user-hl8yp8in9b Год назад +1

    Great video. One catch I have found with this is if the filenames are the same your form will fail. Is there a way to change the filename to include a date and time stamp in the name upon submission to avoid having a duplicate?

    • @cvkealey
      @cvkealey  Год назад

      You mean like this: ruclips.net/video/PRwUn0aZysM/видео.html ?

  • @chrisjpeltz
    @chrisjpeltz 2 года назад

    Works great! How do I get a URL to the new file uploaded so that I could reference it in a future step where I went to send an email out with a link to that file? (not the actual file, but the link to it)

    • @cvkealey
      @cvkealey  2 года назад

      You could use the "Path" output of the Create file action (assuming the recipient has permissions to it) or throw in a "Create sharing link" action with the appropriate scope (anyone or organization) and permission (view or edit) and use the "Link" output of that.

  • @ElisaLeonelli
    @ElisaLeonelli Месяц назад

    Hi Chad, I followed every step of your excellent tutorial, but I'm unable to insert 'one driveid.id' as you suggested in the 'Get file metadata' action. These values don't appear in the dynamic content. The only values that appear are Body name, Body link, Body id, Body type, Body size, and Body reference id. Do you have any suggestions? Thank you

    • @cvkealey
      @cvkealey  Месяц назад

      Try switching to the classic editor (toggle in the top right corner). Things show up a little different in the new editor, but if you switch to the old one, everything should look like it does in the video.

  • @badboygaming1231
    @badboygaming1231 5 месяцев назад

    I can’t believe you just gloss over the concat step and continue. It was going so well until then 😂

    • @cvkealey
      @cvkealey  5 месяцев назад

      If you mean the . part, I think I explain that pretty clearly. I mean, I don't drill into why you need to use that sequence, but I wouldn't say I "gloss over" it. However, I know a number of people have commented that they had issues where they missed/forgot that . in between.

  • @redkulaT
    @redkulaT 3 года назад

    Are you able to do one for an email trigger with the file link?

    • @cvkealey
      @cvkealey  3 года назад

      You mean "When an email is received"? There are a few templates built around that trigger that save attachments to OneDrive or SharePoint. Check those out and I think you'll find what you're looking for. If not, give a bit more detail on what you want to achieve.

  • @practicalphysicswithwaruna2382
    @practicalphysicswithwaruna2382 3 года назад

    Why Microsoft File Forms do not include file upload under Add New?

    • @cvkealey
      @cvkealey  3 года назад

      The file upload question type is only available for forms where you only allow people in your organization to submit it. It sounds like you have an anonymous/anyone form.

  • @michigandnr4161
    @michigandnr4161 2 года назад

    We just want to add a link to the image in the custom list so all the information from the form is available right there, not move the files to a new location. Since it's a team group, everyone already has access to the files, no need to move them. Any tutorials on how to do that? Thanks.

    • @cvkealey
      @cvkealey  2 года назад +1

      When you parse the JSON of the file upload question response, one of the values returned is the "link", which is the full URL of the file. You can add a hyperlink column to your list and populate it with that value. This should work fine if you limit the question to allow only one file upload. In that case, the data is still returned as an array (of just one item), so you'll need to use the "first" expression to get the first (which also happens to be only) link from the JSON. It'll be something like "first(outputs()?['link'])"

  • @sandysmajic786
    @sandysmajic786 2 года назад

    Hi, how can I use this for multiple uploads, since I have multiple questions with upload in my form

    • @cvkealey
      @cvkealey  2 года назад

      Short answer: repeat the steps (parse json, get file properties, get file content, etc.) for each question. If you put those steps inside of a scope, you can copy & paste the scope to save some clicks. Also, see my updated playlist on this topic: ruclips.net/p/PLMVyjgrWIGnwQowO2RsvHg0pZ8EozvAG- for more details.

  • @xien82
    @xien82 2 года назад

    I appreciate your knowledge sharing. by the way, how can I get the uploaded file's URL?

    • @cvkealey
      @cvkealey  2 года назад

      When you parse the json of the file upload question response, it's in the 'path' property.

  • @studiotech6194
    @studiotech6194 2 года назад

    What happened if the attachment is not included on the form i am getting error message from Parse JSON how can i stop it please. InvalidTemplate. Unable to process template language expressions in action 'Parse_JSON' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'. any help

    • @cvkealey
      @cvkealey  2 года назад

      See ruclips.net/video/jBTmX0cm6NU/видео.html for details on how to adjust your flow to accommodate non-required file upload questions.

  • @carlosmelendez7520
    @carlosmelendez7520 Месяц назад

    Hi Chad.. the files are sent as an attachement however, when I try to open them I get and error and even though I can download them, they are not opening

    • @cvkealey
      @cvkealey  Месяц назад

      Are you certain you're including the file extensions? That's the most common issue.

  • @marinaaparicio3985
    @marinaaparicio3985 3 года назад

    Hi since it appears the file is saved on an individual's one drive will this work when the form is used for several people in the organization to submit information on a form?

    • @cvkealey
      @cvkealey  3 года назад

      When it's a personal form, the files are stored in the form owner's OneDrive. When it's a group form, they are stored in the Documents library in the group's SharePoint site. The steps shown in this video will work in either case (that is, even when they're stored in SharePoint, you need to use the OneDrive actions to "get" the file & its content before you can save it somewhere else).

    • @marinaaparicio3985
      @marinaaparicio3985 3 года назад

      @@cvkealey Thank you! This was very helpful. Is there a way to have the file name show in a nicer format in the SharePoint List? It comes out with the entire path showing obviously which is extremely long and does not look very appealing.

    • @cvkealey
      @cvkealey  3 года назад

      @@marinaaparicio3985 are you certain you're selecting the name and not the path when creating the file? Can post a message to the Power users community with some screenshots? You can tag me there (ChadVKealey)

    • @marinaaparicio3985
      @marinaaparicio3985 3 года назад

      @@cvkealey This is what comes up in the online view of the list: [{"name":"Finance Engagement Team Job Board_Kellie Walton.docx","link":"​docx icon Finance Engagement Team Job Board_Kellie Walton.docx","id":"01X3JF3XPEO47GTBO3UBEISMAF3IRZAWZ6","type":null,"size":13901,"referenceId":"01X3JF3XKXU3557WTMVNEYMRGEV2LP55QL","driveId":"b!rfGzbH5800K0iKPesqKWsJPnGD7x4exFgMlLJRcsCXd1RzTVgbtiQYyAicxMl204","status":1,"uploadSessionUrl":null}]

    • @cvkealey
      @cvkealey  2 года назад

      Sorry for not responding sooner. You need to run that through the Parse JSON step (starting at around 4:10 in the video) to extract the individual parts, including the name.

  • @juancillliers8786
    @juancillliers8786 2 года назад

    Hello, Is this flow still valid or is there an update required. I keep getting a file not found 404 error under the create file. There seems to be a mismatch in the request ID's.

    • @cvkealey
      @cvkealey  2 года назад +1

      The instructions in this video are still valid. It's important to note that while OneDrive and SharePoint both have some properties with the same name (like "ID"), they do not store the same information, or at least not in the same format. I have an updated playlist that goes into more detail and may be useful to you: Microsoft Forms, Uploaded Files and Power Automate: ruclips.net/p/PLMVyjgrWIGnwQowO2RsvHg0pZ8EozvAG-

    • @juancillliers8786
      @juancillliers8786 2 года назад

      @@cvkealey Managed to come right based off your videos. I had to create two "apply to each rules", the first one connected to "body" looping through "get file contents" and then "append to array variable". The second "apply to each" connected to the varFiles initialize variable to "create item".

  • @eddoria01
    @eddoria01 3 года назад

    Have you a video on sending an email once a form response is received. I would like to show the attachments in the email so the user does not need to go to SPO.

    • @cvkealey
      @cvkealey  3 года назад

      Not specifically on that, but since you need the file name and content to attach it to an email, it's very similar to this. Just replace the "create file" action with a "send email" action and plug in the attachment name and content. If you need to attach multiple files, you'll need to create an array variable and append each one to it, then you can attach the array in the email.

    • @cvkealey
      @cvkealey  3 года назад

      Check this out: ruclips.net/video/az23pHVLdSo/видео.html

  • @nikhiljagtap4488
    @nikhiljagtap4488 2 года назад

    I want to upload .xml file through MS Forms, is it possible? If not with forms, is there any other way to upload .XML using Microsoft tools?

    • @cvkealey
      @cvkealey  2 года назад

      Xml is just a text file with special markup/structure. By default, forms does not limit the allowed file attachment type, so I would suspect this same process would work.

  • @heathervo9144
    @heathervo9144 Год назад

    How would we go about deleting the files after they're pushed into sharepoint? Especially if it's mutiple attachments in different folders.

    • @cvkealey
      @cvkealey  Год назад

      You'd need to add the appropriate "delete file" action (OneDrive for personal forms, SharePoint for group forms) after they're saved. Personally, if it were more than a couple of files, I'd probably put the relevant details (file identifier) into an array along the way and then run the delete file action in an apply to each loop iterating through that array.

    • @heathervo9144
      @heathervo9144 Год назад

      @@cvkealey thanks for the fast response. I'll try that. I'm currently watching the playlist that goes into detail. I'm on the step where I'm attaching the array to the attachment field, but I keep receiving the error either "To, Subject, Body" is empty or "unable to access body or attachment" or "$content-type missing :". Do you have any additional suggestions?

    • @cvkealey
      @cvkealey  Год назад

      @@heathervo9144 double-check what you're putting into the attachments array. You need to provide the name (with the extension) and the file content (output from the "get file content" action). In general, inspect the inputs/outputs from a failed run to see what data is actually being used.

    • @W3stSid3Vi3t
      @W3stSid3Vi3t Год назад

      @@cvkealey currently have a variable to look at the completed outputted array and I don’t see any issues except for addslashes. I went in and looked at every time I iterated the array and the get content files and everything looks correct so far

    • @cvkealey
      @cvkealey  Год назад

      @@W3stSid3Vi3t Hrm...it's kind of tough to troubleshoot these issues here. I'd suggest posting a message in the Power Automate Community (powerusers.microsoft.com/t5/Forums/ct-p/FL_Comm_Forums) with some screenshots of your flow's configuration and the error messages. You can tag me there (@Chad_V_Kealey) and I'll take a look.

  • @suzueli
    @suzueli 2 года назад +1

    Great video, but what happens if the upload file is no required. I am having an error because the null is not working. Any solution?

    • @cvkealey
      @cvkealey  2 года назад +1

      There are (at least) two ways to handle that. You could use a condition to check if the file upload question has a response (see ruclips.net/video/fSeGEBEs-kA/видео.html). Alternately, you could use the "configure run after" property/setting (see ruclips.net/video/jBTmX0cm6NU/видео.html). Either one will work if implemented correctly. Both can be a little tricky, so pay close attention to what's shown in the videos.

    • @cvkealey
      @cvkealey  2 года назад +1

      There are (at least) two ways to handle that. You could use a condition to check if the file upload question has a response (see ruclips.net/video/fSeGEBEs-kA/видео.html). Alternately, you could use the "configure run after" property/setting (see ruclips.net/video/jBTmX0cm6NU/видео.html). Either one will work if implemented correctly. Both can be a little tricky, so pay close attention to what's shown in the videos.

    • @suzueli
      @suzueli 2 года назад

      @@cvkealey thanks i’ll try

  • @EzStory
    @EzStory 4 месяца назад

    Thanks for your sharing sir, but i have a problem "Action 'Get_file_metadata' failed"

    • @cvkealey
      @cvkealey  4 месяца назад

      It sounds like the identifier you're using isn't correct. Is the form a personal form or group form?

    • @cvkealey
      @cvkealey  4 месяца назад

      See this playlist for more info: ruclips.net/p/PLMVyjgrWIGnwQowO2RsvHg0pZ8EozvAG-

    • @ezraroellstoa
      @ezraroellstoa 4 месяца назад

      Personal form​@@cvkealey

  • @indichick36
    @indichick36 2 года назад

    Is there a way to rename the file?

    • @cvkealey
      @cvkealey  2 года назад

      Yes. When you're creating the file, you can use whatever name you'd like. In this example (see ruclips.net/video/amByVPsgUw8/видео.html), I'm using the 'name' of the uploaded file (extracted from the file upload response). But, it could be anything. However, if you're writing the file to a SharePoint library, remember that file names need to be unique. If a file of the same name already exists, it IS smart enough to just append a number to the end to make it unique (e.g.: if you attach a file named "document.docx", and a file with that name already exists in the library, the new file will be named "document 1.docx").
      In fact, in most of the processes where I'm using this, I am re-writing the file names to enforce a specific naming convention, usually based on data submitted in the form. For example, one department has their faculty use a form to upload the syllabus for their course. In the form, they select the subject code, then type in the course number and section number. In the flow, I use that information to build a name in the format "(subject-code)-(course-number)-(section-number)_Syllabus" AND populating columns in the library for those values as well.

    • @NoleeXC
      @NoleeXC 2 года назад

      @@cvkealey is there a way to get rid of the name of the MS Form submitter? I see it auto added to the file name.

    • @cvkealey
      @cvkealey  2 года назад +1

      @@NoleeXC Here you go:
      ruclips.net/video/PRwUn0aZysM/видео.html

    • @NoleeXC
      @NoleeXC 2 года назад

      @@cvkealey Thank you!!! This tutorial was exactly what I was looking for.

  • @totem9
    @totem9 2 месяца назад

    Can I rename the file

    • @cvkealey
      @cvkealey  2 месяца назад

      Yes. See ruclips.net/video/PRwUn0aZysM/видео.html