Extract PDF data using Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and a very warm welcome in this tutorial we will extract data from PDF forms using power RMA so before we get into the demo let's look at a use case I have got few forms in my SharePoint document Library the forms looked like this I want to go ahead and extract data from these forms mainly the form fields from the PDF such as name travel the date of travel description this data I want to update in a SharePoint list to do that we are going to use power automate so firstly I will start with creating a flow this is a one-time activity that is why I'm going to use an instant flow however you can go ahead and create automated flow for example when a file is created or modified or run it on schedule it's completely dependent on your use case so here I have selected a manual trigger next what I'm going to do is I'm going to get the files from SharePoint so I'll say get files properties only and I'll select the site I'll select the library travel request next I want to go and get the file content so I'll say get file content I'll select the site and I'll pass it the identifier the identifier is the output of the get file section as soon as I pass in the identifier it decorates the get file content with a apply to each Loop because the output of the get files is an array now that I have the file content the next step is to extract the fields to extract the fields I'm going to use the mohamby export form data action to this I am going to pass in a source file name so it's going to be file name with extension and I'm going to pass it the file content which is the output of the get file content action I'll export it as an XML next what I'm going to do is I'm going to add a compose so that I can go and look at the output I'll add a compose and I'll pass it processed file content at this point I am going to run my power automate such that I can see the output of the data in a compose action so I'm going to click on test and I'm going to run it manually perfect so let's expand the compose action and you see that the compose action has actually returned as a base64-bit string but we don't want that so what I'm going to do I'm going to type in a formula base64 to string and here I'm going to pass it the processed file content and this time we should have the output as a string rather than a base 64-bit encoded string perfect so here there is the compose action and we get the data as an XML Perfect The Next Step would be to extract meaningful data out of this XML and update it in a SharePoint list are updated in a column for the SharePoint list so to do that I need to go and use XPath to pass the data the however the first step would be to actually get the data so to get the data I'm going to use an online tool code beautify.org and here I'm trying to create and I'm trying to extract data from it so the data that I need is name the name one that is the description and then the date so let's see so first it tells me if I just hit the forward slash like this it will give me the root element after I get the root element I can actually specify the name of the root element the name of my root element is Fields so Fields perfect so it returns me the fields after the fields I need to go into the node the node in my case will be name so I can say text test XPath and it returns me Richard M next what I want to do I want to access the text property of it so I can say text so this is my X path and this is the X path that I'm going to use in power automate to extract data right so similar to the name I can also get name one and I can also get the date so I can use these formulas in my power automate so let's create the list items so to create the list items I'm going to use SharePoint connector and I'll type in create item I'm going to select the site and I'm going to select the list name that is travel details next what I want to do is I want to fill in the blanks with the data that I exported so to do that I need to use an X path which I created so firstly I need to pass in my data in an XML format so let's start with creating an expression so expression XML and I want to pass in the data the data is now as of now in the compose action so compose next I want to use XPath so the XML is there I need to give it an X path path so this is the path that I need to give and I'm going to say name because name is the first field I want to extract next I want to decorate this with single quotes or else the formula will scream at me and this should return an array so I just need the first element from the array or the collection and that should be it let's see if a formula works perfect a formula works so I can copy the same formula and just change the expression a little so the date of travel will be date dot text and the description would be name one dot text perfect so that's it the time has come to test our solution so I'll say my flow and I'll test my flow again so I'll set it to manual I test it run done our flow has completed successfully if I go back to my details list and if I refresh here my friends I have got all the data extracted from the forms and updated to the list I hope this tutorial was informative and thank you for your time bye bye foreign [Music]
Info
Channel: Muhimbi
Views: 4,029
Rating: undefined out of 5
Keywords:
Id: w_aco14J3Zg
Channel Id: undefined
Length: 7min 55sec (475 seconds)
Published: Fri Jun 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.