Create Dynamic PDFs with Tabular Data using Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone razza here in this video I will show you how to generate documents PDF or word from a template with Dynamic data coming from your data source this will also include tables within the document so let's check it out in [Music] action our goal is to generate documents word PDF with tabular data coming from our data source a SharePoint list a data ver table I have a list that tracks project information and I have a second list that has task information wherein each task is connected to the project via a look up column experience first step is to create a template in Microsoft Word I am signed into word with my M365 account here I'll search for a template related to project report I'll go ahead and pick this one which says project status report and click create I'll keep my template simple I'll go and remove the stop section project summary has the report date project name instead of prepared by I'll change this to project manager since in my SharePoint list I'm tracking who the project manager is status summary I'll change this to the project name is currently in project status you can also add formatting project overview I'll rename this to tasks overview task would be the title of the task I'll add status the due date and I have priority I'll go and remove the last column I'll go ahead and remove the remaining sections and at the end I'll say notes so I've got my template ready but I need to insert Dynamic elements into my template and for that I will leverage the developer tab report date I'll select the text date enter plain text go to properties and give it a unique title project name I'll do the [Music] same project manager I'll do the same status summary this text I'll make it plain text properties and the project status plain text and give it a title now for tasks overview I'm trying to create a repeating table first thing I'll do is I'll enter some sample textt here like task name this will be the status due date and priority and I'll make each of these Dynamic this is Task name task status task due date and task priority now the other rows I'll go ahead and delete them and I will go ahead and select the complete first row and go and insert a repeating section content control make sure you go and select this repeating section go to properties and I will call this my tasks table I'll click okay and for notes added a plain text control and set its property title that completes my template I'll go ahead and save this to my one drive and I will call this project report template that's gone ahead and uploaded the file to my one drive power automate I'll head over to create and start and inst in Cloud flow that triggers for a selected item in a SharePoint list I'll click create this flow I will give it the name generate project report the flow will trigger for a selected item in my SharePoint site for my projects list I can also take inputs from the user let's go ahead and take an input of type text these would be the notes that I would like to add in my notes section next step I will use the action get item to get the details of that selected item connect to my SharePoint site connect to my projects list the ID will come from the dynamic Content ID from my Trigger action next I need to get the tasks so I Leverage The Action get items from SharePoint connect to my SharePoint site connect to my tasks list and here I would want to filter the data to only show the tasks where project lookup is filtered to show the data for the selected project here I'll add a filter query my lookup column has the internal name project lookup I'm going to connect to the title of the project I'll check to see if this is equal to the title Dynamic content coming from the get item access action this will have the name of the project I can rename this action to get tasks Next Step I'll search for word we have the word online business connector here I will use the action to populate a Microsoft Word template the location of this template is in my one drive the document library is one drive and my file was called project report template and I'll put the extension of my file it will try to find that file in the root of my one drive folder which it has found and now it will ask me to go and populate the dynamic content project manager name status date and again again project name all of this will come from my projects table project manager I'll search for project manager this is a person type column I'll want to show the display name of the project manager project name this will come from the title column get item Action project status status is a choice column so I'll pick status value project date this is the date of the report so I want to put today's date and time and I would like to format that date as well so I'll use the Expression format date time UTC now which gets me the current date and time and I would like to format this in month day and your format project name title tasks is an array I'll just put some sample values like name status date and priority and I will go to switch to input entire array right after get tasks I'll go and insert an action go to data operation and pick the select data operation from expects an array of data list of items Dynamic content called value coming from the get tasks action I'll select this next we need to define the mapping I'll keep the the mapping consistent with what my tasks table repeating section expects task name I'll enter the value later task status task due date and task priority now all I have to do is set the values task name will come from the title task status I have a column called task status I'll pick value due date and priority once again a choice column for tasks table I will clear and go and pick the output of the select action Dynamic content we have notes this will be the notes input that we added in the Trigger action so this goes and populates the word template now all we have to do is go ahead and create a file with the document data that this action has generated I'll go and create the file in one drive I'll just save it at the root the name of the file I'll try and make this unique I'll put the title of the project underscore I'll put the current date and time dot doc X and the file content would be the dynamic content Microsoft Word document coming from the populat Microsoft Word template action if you want a pdf version of that go and add a new Step once again select the Microsoft Word online business connector we have an option here convert Word document to PDF location one drive Library one drive and the file I'll pick the dynamic content path I'll send it as an email to switch to advanced mode search for user email the Trigger action for a selected item knows which user has triggered the flow so I'll simply send an email to that user subject I'll say project report 4 and put the title of the project in the body I'll say please find attached the report and in attachments here I'll put the name of the attachment I'll put the project name do PD PDF extension of the file is very important attachment content would be PDF document coming from the convert Word document to PDF action and that completes my flow I'll go ahead and save the flow is saved now this flow the owner of the flow is me as I've built this flow if you want to give your users of that SharePoint list access to run this flow run only users go to edit go to SharePoint pick the SharePoint site and the list I'll click add we can also Define the connections the word action the one drive action I want to Simply run that under my own account because I have access to the template and it's it's pointing to my one drive I'll click save I'm signed in as a user Sarah who has access to this list Sarah can select a specific item go to automate this will list out any flows that are associated with this list that Sarah has access to run generate project report was our flow I'll click this I'll click continue I'll add my note run the flow Sarah was the one who triggered the flow here is the email that Sarah has received which has the report for the project contoso select the attachment here is the PDF the report date that's today's date the name of the project project manager the status of the project is in progress here is a list of all the tasks that are related to the project contoso and here is the notes Here I have a template called expense report template I've mapped my content controls expenses this is my repeating section content control in data ver I have two tables that are related with each other an expenses table and foreign expense there can be multiple line items I have a canvas power app where the user can go fill in the expense details and add line items for an expense here is an expense called Koso customer meeting I'll click submit for approval this will go and Trigger the workflow process each expense is related to a cost center and in the cost cost center is where I've defined my approvers dynamically resa is the approver for the cost center Microsoft here is the expense approval task I can directly approve or reject this expense I'll say approved email States your expense request has been approved and here is the attached PDF includes all the data dynamically coming from my datae tables 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: 32,448
Rating: undefined out of 5
Keywords: power automate, microsoft flow, convert to pdf, microsoft power automate, power automate tutorial, power automate convert to pdf, sharepoint list to pdf, how to, power automate pdf, power automate pdf creation, power automate examples, repeating section content control, reza dorrani, Convert Word Document to PDF, pdf, convert to pdf from word, create pdf power automate, create dynamic pdf, how to create pdf file in power automate, insert table in word, create pdf
Id: KVnfWsO1Fhs
Channel Id: undefined
Length: 16min 41sec (1001 seconds)
Published: Mon Mar 04 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.