Upload a File With a Few Meta-data Fields.
This is function 2. In SharePoint, in that location used to be a mode to have fields/columns that were required for documents, and when a certificate was uploaded, the user was prompted to make full in those required fields. As you lot may have noticed, in SharePoint Online, documents tin can be easily uploaded and bulk uploaded without annihilation prompting you or preventing upload/bank check in if the required fields aren't filled out. The fields practice show in xanthous in views, but there isn't really a way to enforce those required fields. In this ready of posts, the next option that you have in SharePoint online to accomplish this. See part 1 in my previous post, which was a relatively simple method.
The biggest trouble with classic SharePoint, was that when someone uploaded multiple files at once, and in that location were required fields, there was never a prompt to fill up in the fields. The files all just went into this "checked out" state where the user then had to know to go into each file's metadata, update it, and check each file in.
The solution in this post gives you a style to create an interface where users fill up in required metadata AND tin upload multiple files, and all of those files get into SharePoint. This is washed using Microsoft Forms and Ability Automate.
1. Go to https://forms.microsoft.com or click Microsoft Forms in your waffle carte du jour at the summit left in Microsoft 365.
ii. Create a new form. I'm calling mine "Demo Upload Files". Annotation that When y'all use the "upload files" functionality in a form nether "My Forms", it puts the file in your own OneDrive.
three. Add all of the fields (questions) that yous'll need people to fill in, and make them required if necessary.
iv. Be sure and add an Upload files question.
5. Name your Upload files question and set the number of files you'd like them to exist able to upload all at once. The max is x. Besides, you may desire to make this a required field. I named mine "Upload SOW".
half dozen. Notation that when you use the Upload files pick in a Microsoft Form, you won't exist able to let this to be an bearding form. In the Settings, you'll detect that it will be fix in the who can fill out this grade section, to Only people in my system can respond. Be certain to requite your form a name. When I click Preview, encounter that mine has only two questions (required) and an upload file button.
When they fill up out the form, where do the uploaded files get? When you've got a "My Class", it goes to your ain OneDrive, in this binder structure:
When you create a Group form, the file goes into that group's SharePoint site. Information technology goes into the default Documents library, in this folder structure:
Besides, detect that and underscore and the submitter'southward proper name will automatically be appended to the end of each file name.
The next pace is to create the flow that will put the files where you lot desire them. Now, this part can be widely varying, per your requirements, but the thought is that you lot want to put the files in SharePoint and and so have the flow set the metadata on those files, per the questions you asked in the form. The affair virtually the group forms is that they're nice because they already put the files in SharePoint, only not with the metadata that you need from the form they filled out.
seven. Create a flow, with the Microsoft Forms trigger When a new response is submitted. Select the proper name of the grade you just created.
eight. Create an action to initialize a variable. Set information technology every bit an Assortment, with the proper noun varArrayFiles
9. Add an action to Get response details. Option the proper noun of the form you but created, and the response Id from the trigger.
10. Add together an action to Set variable. The list of uploaded files from the filled out form is an array of files. For the value in the array, use an expression. Blazon json() and put your cursor in between the parentheses. Then, click the name of your file upload field in the response details. Mine is called Upload SOW.
xi. The event is this. Click Update. The reason I'one thousand not posting the entirety of the code, is because information technology uses the unique ID of the field from the course, and yours volition have a different ID than mine.
12. Add an Apply to each loop. In the output, select the varArrayFiles.
13. In the loop, add the action Get File Content. If you are using a "My forms" form (from stride 2), use OneDrive get file content, and if yous're using "Group forms" use the SharePoint go file content action.
Use an expression here as follows
This expression uses the ID of the file that it's looping through. For each file that was uploaded, it gets the file contents. Annotation that this will always exist an array with a loop, fifty-fifty if you are just allowing one file.
fourteen. Add a SharePoint action in the same loop, Create file. Select your site and library where you'd like the file to exist placed. For the file proper noun, use this expression:
15. For the file content, select the file content from the previous activity.
16. Add another SharePoint activeness in the loop, Update file backdrop. Use the ItemID from the previous action.
This is where yous'll need to identify the values of all of the metadata fields from the Microsoft Form that was filled out, from your Get response details activeness. This role is a huge pain because it's hard to tell which fields are which:
This may need more arrays if you have more complex fields that involve multiple choices, etc, but that's the gist of it. To me, trial and error was the best mode to tell which field is which, by trying it and selecting different questions to put in the fields on that last step. After the flow has run at least once, you tin look at the raw data in the become response details action, to exist able to see which question GUID goes with which responses. The terminate issue is that all of the files that they upload to the class will end up in SharePoint, and the metadata questions that they answered will be populated in columns that you lot've created in your library. So, yes if you hadn't already created columns in your library, those volition need to exist, equally you run into with my "customer" and "hours" columns in the screenshot to a higher place.
Note that the files are going to announced equally "created by" you, in SharePoint, you the flow creator. If you'd like to capture the name of the person who uploaded the file (besides only in the file proper noun), I recommend creating an additional "person" column in the library, and populate it with "responder's email" from the dynamic content of the response details.
I've detailed this whole procedure in this video, starting at 23:38.
Hither's the whole menstruum:
![](https://wonderlauracom.files.wordpress.com/2020/11/whole-flow-form-to-sharepoint-metadata.png?w=653)
millerhumbecioned.blogspot.com
Source: https://wonderlaura.com/2020/11/16/required-sharepoint-metadata-multiple-files/
0 Response to "Upload a File With a Few Meta-data Fields."
Post a Comment