Save Microsoft Forms Data and File Uploads to SharePoint After Approvals via Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone RZA here in this video I will show you how we can run approvals on Microsoft form responses which includes multiple file upload questions we will take the response from the Microsoft form submitted include all of the details including the file uploads as attachments to the approver so that they can take their approval decision so let's get started with this [Music] video let's begin with creating a very simple Microsoft form I will use this form to track idea submissions from employees I'll add a text question I'll call this Ida title make this required I'll add add another text question IDE description I'll not make this required description I'll make it long answer I will add two upload file options the first one I will call it as supporting documents I can Define how many files for this specific question can the user upload I'll restrict this one to three and I can also Define the single file size limit I'll make it required and I will add one more upload file option I'll call it images once again I can Define how many can the user upload its size I won't make this a required field and with the file upload question if you go to the three ellipses we can also Define the file types I only want image files I can simply unselect the remaining options now at this point if I was to preview this is what my form looks like since I'm using the upload file option this becomes a non anonymous question meaning the name of the user filling the form and the file upload actions will be recorded in one drive and visible to the form owner if I select collect responses since I picked file upload only people in my organization can respond I want to record their names additionally if I go to settings one of the features that we have inbuilt in Microsoft forms is to get email notifications of each response that we receive so I'll go ahead and and turn this on and at this point my form is ready to be shared with my end users so I'll go ahead and submit this form I can give an IDE title idea description supporting documents is required so I have to upload at least one file here I'll upload a couple of files I can optionally upload images I'll go and upload an image and I can go ahead and submit my idea now at this point the owner of the form which is my account will receive an email that highlights a new idea has been submitted all the owner gets is a link to view the results of the form so the user has to click on it which takes the owner of the form to the page where they can see all the responses I can see the details the attached documents if I want to look at the files have to go to more details then click at the file then it will go and open that specific file for me and bear in mind all of these files there's an option here that says view in folder if I select this since I I created this Microsoft form the data is stored in one drive we can see that I have a folder called apps in which there's a folder called Microsoft forms within that is the name of my form which is idea submissions the files will be loaded in one of these folders so the first question that I added related to supporting documents here are the documents and then I have another folder fer that is maintaining those images the name of the file has the name of the user appended to it that's the user who has filled out the form let's start with our first scenario whenever I receive a response for an idea submission I would like to receive an email that includes the details of the submitted idea and all the files and images should be available as attachments to do that we will take the help of power automate in make. powermate.com I will head over to create and I will begin with an automated Cloud flow that triggers when a new Microsoft form response is submitted I'll give this flow a name and I will click create the trigger is asking for the form idid I can simply type type the name and pick my form next step I would like to get the response details from Microsoft form once again it's asking for the form ID I'll pick ID as submissions and the response ID will come from my Trigger action Dynamic content response ID I'll add a new step I will use the select data operation action from expects an array of data file upload question type always returns an array of data and the response that we receive in the get response details action comes in the form of a Json array but in string format select expects array format so here I will go expression and use the Expression function Json with my mouse cursor right in between these two brackets I'll go to Dynamic content and from get response details I will pick supporting documents I'll click okay I'll rename the select action to select supporting documents and in the map I'll add a key type this I'll call it supporting docs and I'll add another key called ID this I will use an expression called item of ID this Json function points to that supporting document question it returns an ID pointing to the file in one drive so that is what I'm trying to fetch here and store in this ID key now the same pattern I will repeat for my next file upload question select data operation expression Json Dynamic content my next file upload question was called images okay type call this image ID expression item id I'll rename this now I want to send all of this information as attachments in an email and currently I only have the ID reference of the file that are living in one drive so what I'll add here is another step I'll use the compose data operation action here I'll use the Expression Union this allows me to combine multiple array of data my first array will be the output of Select supporting documents comma my second array will be the output of Select image files so this is an array of all my file uploads coming from my Microsoft form and now all I have to do is Loop through all these file uploads I'll add a new Step apply to each here I'll pick the output of file uploads within this I'll add an action to get the content of the file from one drive for business here it's asking for The Unique identifier of the file that I have already stored in this key called ID so here I will simply use the Expression item of ID I also want the name of the file I'll add another action called get file metadata once again from one drive for business and the unique it identifier will be that same expression item of ID now that I have the file name and the file content it's important for us to understand what is the format in which we can send attachments to send an email action so right after apply to each I'll add a new Step send an email action Office 365 Outlook I would like to send this email to myself the subject will be new idea submitted hyphen I can also give Dynamic properties about the idea from get response details action I already have the idea title so I'll plug that in the subject in the body I'll give the idea title and I'll give the idea description and I would also like to here the responders email that's the individual who filled the Microsoft form and for attachments if I go to show Advanced options here we can add attachments to see the format this expects attachment name I'll just call it test attachment content I'll just type data the key here is if I switch to input entire array this is the format that it expects it needs an array that has two pieces of information the name that's the name of the file and content bytes that's the file content now that I've understood the format that it expects before apply to each I will go ahead and initialize a variable I will call this where add AR files to email the type will be array I'll rename this action array files email I'll leave it empty to begin with and then apply to each after I get the file content and metadata I will add an action I will use the append to array variable action CU I want to append data to this variable table and here I need two Key properties which are name and content bytes in this object so open curly brace close curly brace name is the first property this is where I need to enter the name of the file this I can directly get if I search for name get file metadata has that name I'll put a comma and write after this content byes colon this will be the file content coming from the get file content action all I have to do now for my attachments at this point is use that variable and that completes my flow I'll go ahead and Save save this my flow is saved and listening to any new ideas that come through in this Microsoft form let's submit another idea I'll add some supporting docs supporting images so total of three files uploaded in two different questions I'll submit the response has been recorded the flow has triggered and it's gone ahead and sent the email and here is the email that I have received it says a new idea has been submitted that's the title title description the email address of the individual who submitted this idea and here are all the files these were the images and here's that supporting document now let's edit our flow and go one step forward when a new idea comes in I would like to First send it for approval right before sending the email I'll add an action here called start and wait for an approval approval type I will pick first to respond the title of the approval will be new ID has submitted and I'll give the title that the user has entered I will assign this to a user Sarah and in the details of the approval I'll provide the idea description I can go to show Advanced options requester I can put in the email address of the individual who is submitting this idea through the Microsoft form attachments once again to understand the format that start and wait for an approval expects I'll enter some sample data here and go to switch to input array here if you notice the format is different it's expecting two properties name and content all lowercase so in my apply to each Loop this array variable that I created was very specific to the format that the email action expects for sending attachments but for approvals it's different no problem I'll go and initialize another variable I'll call this where array files approval type array in apply to each I'll add an action append to AR a variable this one I will append to the approval action and I literally can copy and paste this here because all I have to change are the properties name content and this variable is what I will use for start and wait for an approval action in the attack Attman's property this will begin the approval of the submitted idea to Sarah and the flow will wait for Sarah to respond once that response is received I'll add an action here a condition to check the outcome of the approval if the outcome is approved then I would like to send this email this time I'll send this email to a security group called cat team and I'll also keep my approver in CC which is Sarah I would also like to give the responder that notification so right here I'll switch to advanced mode semic colum from Dynamic content I'll pick the responders email the submitted idea has been approved if it's rejected send an email this one should go to the responder of the form the idea submitted has been rejected and here I can plug in the commments that are provided by the approver that completes my flow I'll save my flow I'll submit another idea uploading a couple of documents uploading an image submit this time when the flow triggers we can see how the flow has started that approval action and is currently waiting for a response from the approver which is Sarah Sarah receives approval task the attached image those are the attached files can also see who the requestor is and Sarah can take the approval decision right here she can approve or reject let's go ahead and approve this one the commands I'll say okay and submit the approval decision is taken directly in the email the flow moves ahead the condition was to check the outcome of the approval because it's approved it will send a notification email that this process is approved Resa who was the original responder of the Microsoft form gets an email that the idea that you submitted has been approved the security group gets no ified the approver and the individual who submitted the for now I'm submitting another idea but this time I am only uploading supporting documents which are mandatory but the other file upload I'm going to leave it empty this time if I submit if you notice the flow has failed and the reason is because the the select action that we added to get data for that specific file upload question always expects that there are files if there are no files it's going to fail so to fix this for select image files in my expression if this expression returns back as null we need to plug in an empty array so for that before this action I will once again initialize a variable I'll call this where array empty type will be array leave it empty call it empty array the file upload question here I will simply copy this expression and change it as follows if equals the first property of equals will be the expression that I copied comma if this equals null in that case my True Value will be that empty array else I'll put that same expression of mine and I will click update now if I test it with that flow run that failed this time if you notice the select image files aray because that question was empty does not have any data and the flow goes ahead and executes all the steps successfully now it's waiting for the approval here is the approval task for Sarah she rejects the idea puts her commments submits her response the flu gets that response this time it moves into the false condition because Sarah rejected it and the user who submitted the idea gets a notification that the idea has been rejected and here are the comments that the approver put in now let's try and take this one step more forward once the approval action takes place yes I'm sending an email notification but I also want to record that idea in a data source of my choice the data source that I will pick for this scenario is SharePoint in SharePoint I'll create a new list called ideas list title is where I will add the title of the idea I'll add a multi-line text column called description every list has an ID column I'll add that column to the view the ID of the idea and also we have an attachments column where list attachments are stored now whenever an idea is approved I want to store the data here so when the approval is approved in the yes Brun I'll add an action to create an item in my SharePoint site which is HR and my list is called ideas list the title will be the dynamic content IDE title coming from the Microsoft form and the description will be the dynamic content idea description coming from Microsoft form now this step only creates the item in the SharePoint list but I also want to add my attachments I will add an action apply to each now the attachments that I'm uploading they will all go in that one section called attachments so I need the content of the file and I also need to know which file upload question it relates to so I'll initialize another variable V array files type array apply to each append to array variable ver array files I'll replicate what I have for the approval action and I'll add another property here called type this will be item of type and now for the apply to each loop I will use where array files I'll add an action to add attachment to SharePoint my site is my HR site my list is my ID as list ID of the item is the ID of the newly created item so I'll pick that from Dynamic content file name this would be item of name and right before this so I'll move my mouse cursor to the left I can also append item of type so type of the file hyphen the name of the file and file content so it'll be item of content and the email action I'll drag it to the Bottom now when I'm sending the email I'll say the idea has been approved in the body I'll switch to code view I'll also give a link to the newly created item in SharePoint simple HTML in the hrf I will use Link to item Dynamic content from the create item action I was sending the attachments I don't need it now because I'm already storing it in SharePoint the user can simply click on the link and see all the details let's go ahead and save this I'll submit a new idea I'll add some supporting documents and also add a couple of supporting images is I'll submit the flow triggers the approval process has started Sarah receives the approval email that has all the attached supporting documents and images Sarah can take her approval decision this case Sarah approves it the decision is recorded the flow will move ahead since the decision was approved it will go and create an item in my SharePoint list you can see all the information from the Microsoft form comes in here it will also add the attachments and we can see that we've tagged those categorizations based on the question whether it's image whether these are supporting docs or any other file upload question of your choice if I select these it will open those files plus it will send a notification email to the security group The approver and the original requester about the idea being approved the details of the idea are here and here's a link that takes us directly to that specific idea that has been recorded in the SharePoint list if you enjoyed this video do like comment and subscribe to my YouTube channel and thank you so much for watching
Info
Channel: Reza Dorrani
Views: 24,948
Rating: undefined out of 5
Keywords: microsoft forms approval flow, microsoft forms approval power automate, microsoft forms approval with attachments, power automate approval microsoft form, microsoft power automate approval workflow, microsoft forms, microsoft forms responses, approvals, microsoft, forms, file upload microsoft forms, multiple file uploads, microsoft form save to sharepoint list, reza dorrani, sharepoint, microsoft forms file upload to sharepoint list, attachments, how to, power automate, workflow, flow
Id: Aerky9hiYDo
Channel Id: undefined
Length: 29min 33sec (1773 seconds)
Published: Mon Oct 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.