Populate a Word Template with Power Automate | How to Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone Resa here in this video I will show you how to populate a Microsoft Word template from Power automate right from framing the word document with content controls like text images to generating the word document from that template with Dynamic data coming from a data source to emailing the generated document as an attachment to storing it in a data source of your choice this video has a all covered so let's check it out in [Music] action we will begin with Microsoft Word desktop experience signed in with my M365 account I can design a Word document of my choice or I can pick from existing templates I'm looking for templates around certificate there is one template here around Employee of the Month certificate I'll go and select this one and say create in order to insert controls that I can populate dynamically I need to ensure I have the developer tab enabled to enable this head over to file options customize ribbon and under main tabs one of the options here is developer make sure this is turned on within the developer tab we have controls so let's begin with plugging in controls into our word template here I'll select the text here that says employee of the month for this text I can insert a control currently the supported controls are documented now for my text employee of the month I will click on Plain text content control and notice it says click or tap here to enter text so I can type some sample text certificate of participation notice the border around this and these three ellipses when I select this we have properties here and for each control that you add to your word document make sure you give it a unique title I will call this SE title and click okay this certificate is awarded to this text once again I'll make it plain text I'll plug in my name once again I'll head over to properties for the content control and I'll give it a unique title for the section below the name I'll leverage plain text give it a unique title the name of the user once again I'll use plain text this will be the name of the person who is going to sign for the signature I have the cursor set right here I'll go and insert the picture content control for the properties of this content control I'll give it a unique title and then for the date I'll insert another plain text control this one I'll call it seert date now that I have my word document certificate template set I'll go ahead and save this and save it in my one drive I'll call this certificate of participation click okay this will go ahead and save this document in my one drive in my one drive here is the certificate I can move it to any folder of my choice in one drive I have a folder called templates so I'll simply go and move it here so this is where my word document is located in power automate let's create a flow that can populate the word document I'll start off with an instant Cloud flow I'll give this flow a name and click create this flow gets manually triggered I'll add an action and search for word from the word online business business connector we have an action called populate a Microsoft Word template first I need to Define where my word template is located my template is located in one drive so I'll head to one drive for business document Library will be one drive and then file I'll open a folder selector here I created a folder called templates and within this I have my certificate of participation Word document under Advanced parameters I'll click show all and this will showcase all the content controls that I added in my word document that I can populate dynamically right here in power aate the placeholders that I put in for those content controls you can see them being listed Ed here as well so let's begin with CT awarded to certificate title certification date and I have one image control now for the image that I want to populate here I already have Matt Smith's signature that I have loaded into a document library on my SharePoint site before populating this word template I'll add an action called get file content from the SharePoint connector my SharePoint site is HR and for the file identifier select my documents Library where that image lives my case it's under shared documents and that file was called signature.png so I will select that file and for populate a Word document for the content control property for image I'll go to Dynamic content and pick the file content Dynamic Property from get file content action and right after this I will go ahead and add an action I'll go ahead and send an email using the Office 365 Outlook connector this email I'll send it to my email address I'll call it certificate of participation I can describe the email body for advanced parameters I'll click show all then to attach the populated Word document to our email under attachments I'll go to add new item attachment name I'll call it CT do docx the file extension here is extremely important and for attachment content I'll go to Dynamic content and pick Microsoft Word document now at this point make sure you switch to input entire array and make sure that for Content bytes where we are populating the dynamic content make sure that there are no double quotes around this I'll go and save the flow the flow has saved now I can go ahead and test this flow I can trigger my flow manually so I'll go ahead and do that and run the flow the flow triggers goes and populates the word document and sends out an email that has the attached Word document I'll go to my mailbox here is the email certificate of participation and here is the attached Word document that is populated based on the template that I created I have a SharePoint list that has information about training attendees the name of the training that they've taken the category of the training what they attended the training and the name of the user who took the training since my categories are defined power apps a power automate in my documents Library I've also stored power apps image and a power automated image now I want to make a slight modification so I'll go back to Microsoft Word and select my certificate of participation template that's located in my one drive temp templates folder I'll go and insert a picture content control this one I'll go to properties and give it a unique title I'll go ahead and save my changes to the word document template back to Power automate I would like to create a flow and instant flow that triggers for a selected item in SharePoint I'll click create I'll give this flow a name I'll call it generate certificate my flow should trigger for a selected item I'll pick my SharePoint site and my list is training attendees I need to get the details of the item I'll use the action get item from SharePoint point to my SharePoint site point to my SharePoint list the ID of the item will come from my Trigger action get file content from SharePoint to get that signature image point to my SharePoint site go to my documents library and point to the signature image I'll rename this action to get file content for signature I'll once again use get file content from SharePoint point to my SharePoint site go to my documents library and here I have my images both for power apps and power automate I want to dynamically pick the image based upon the category of the training that the user attended not the name of my category and the name of my file are exactly the same for now I'll pick one of the options the trick here is go ahead and copy this and right before I'll go and add a simple compose action which is more like a static variable I'll paste the file identifier right here where it says power apps I'll remove that both my files have the same extension with my cursor pointed right before the file extension from Dynamic content if I search for category the get item action has category value category is a choice column in my SharePoint list I want its value so I'll select this so this will dynamically set the file identifier so instead of hardcoding this here I'll go ahead and use the output of compose but before doing this extremely important go to expression and use encode URI component make sure your cursor is in between the round braces go to Dynamic content and pick the output of compose click okay this will dynamically generate the file content for the category of the training that the user has taken I have all the information I need now all I have to do is go and populate my word document the location one drive for business document Library one drive my file is located in a folder called templates that's the file the moment I select this it will open all the content controls that I plugged into that word template certificate awarded to this is coming from the column user which is a person type column if I simply search for user from the get item action I'll pick user display name pick signature that will be file content coming from get file content for Signature action seert title this will come from my title column category pick that will be dynamic content file content from get file content for category certification for that will come from my category Choice column I'll pick its value date I have a date column called Date attended so I'll pick the value from there the name of the person who has made that signature in my case it is Matt Smith next I would like to go ahead and send this as an email to that user so two I'll switch to Advanced and pick the email address from that user person type column subject certificate of participation for I'll plug in the title of the course body I can plug in other Dynamic content I would like to add the attachment information the attachment name I'll call it certificate do docx don't forget that extension attachment name will be dynamic content Microsoft Word document make sure you switch to input entire array and ensure that there are no double codes around the dynamic content for Content bytes next I'll go ahead and attach this word document to my list item I'll use the add attachment action in SharePoint pick my SharePoint site pick my SharePoint list ID I'll pick from the trigger file name certificate. dox and file content will come from Microsoft Word document Dynamic content that completes my flow I'll go ahead and save my flow has saved in my SharePoint list I can pick an item go to automate that should list my flow my flow was called generate certificate I'll select it click continue and run the flow the user in this case is myself so I should have received an email that has the details Dynamic content title date all coming from my SharePoint list and if I explore the certificate here's the title here's the image for power apps it's being dynamically picked based on the category certificate awarded to Reser for power apps here's that signature here's the date let's try this out for James Taylor I'll run the flow here is the email that James has received here's the attachment here is the certificate dynamically being generated for James and since the flow ran for both of these items you can see that these items have attachments if I view this item here is the attached document that's the certificate if you enjoyed this video then do like comment and subscribe to my YouTube channel and thank you so much for watching
Info
Channel: Reza Dorrani
Views: 31,678
Rating: undefined out of 5
Keywords: power automate, microsoft power automate, word template, power automate word, power automate examples, power automate word template, word templates, microsoft word template, ms word template, populate word template power automate, power automate tutorial, create word template, populate word template, reza dorrani, how to, microsoft word, power automate generate dynamic documents, word document, populate word document, populate word, power platform, tutorial, word
Id: vpo_U5Qf1ak
Channel Id: undefined
Length: 18min 29sec (1109 seconds)
Published: Mon Feb 26 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.