Extract PDF Invoice with Text Manipulation in Microsoft Power Automate Desktop (Part 1 of 3)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys welcome to ms pablo automate in today's video we will learn how to perform text manipulation by extracting data from pdf invoice there are two parts one is to extract all the general information and another one is to extract all the table items okay so first of all i would like to show you an example so i have five different sets of pdf form both of all of them are has the same format so let me open them okay so uh all of these invoices contains the same information so what we're going to extract is the invoice number date due date bill to contact balanced view and the item quantity unit course amount and lastly subtotal tax shipping and total so this we call this as a table items whereas this information here and invoice due date date balance and d2 is considered as the general information so we're gonna do one one part at a time find an action here called extract from pdf okay so i use i swipe text from pdf right and okay so let me open one of this file and i click save so first of all you also want to understand how power ultimate extract the text right and what is the output so after we use this action we try to run and let's see the output so it gave us a chunk of text where everything is in the new line format so but in order for us to get this invoice there and you did we have to know the index right because it's hard part it's hard to tell um where to find this invoice because there could be multiple way where over here we have maybe let me open this right i put it into a notepad okay so maybe there could be scenario where we have another contactor and then some information okay so that's why we try to split it into a new line okay so um from here to split a new line here we can use a split text so the text that i want to split i pass in this data and the standard delimiter is a new line and it will give me a variable called text list so let me run this again and then you will be able to understand what's the output so as you can see here there's an index okay so from here it's easier for us right so we can use it for each loop to look through to get all these sets of information okay so there's multiple ways to do this but i'm gonna do the most simplest way okay since we have two parts i'm going to create a subfloor to actually just generate uh to just extract the general information okay so let's try general info so from here right what i will do is for each item in the text list okay so from here if you take a look there is a pattern right always a new line i want to look for this value for each item if the first operand which is the current item maybe i want to put it more i'll use a trim here 3 contains this value invoice maybe i can just use this small case and then i've got in no keys okay if contains this right i'm going to get the value here but how do i get here so i have to use another split text right so i split it based on this colon then i able to extract this value okay so i use a split text and the text to speed i will use current item a tree and then are you standard no i'm going to use custom and i use this and then the variable chord here i want to name it as item list okay so if you let me try to run this okay my back i forgot to do one yeah i use one subflow and i call this method okay let me run okay i'm again going to stop here take a look at what's the output here so you see the first index is inverse the second and this is this we already got the number so we can use this concept to actually extract the invoice date due due to contact balance new subtotal tag shipping and total okay so from here right we're gonna use a set variable and we're going to name it as invoice and we call it as item list and then it will be always at the second index so the second that is one then we put dot 3 and let me copy this and save so you can repeat the same concept for the rest but for this time right for the date is very tricky because if i were to use if it contains date it will actually override this date and also this date because both of them contains date so we're going to put it an additional nested if condition so we're going to use else e okay if operand we use as current item.string contains div okay in our case we put c right and then we're going to do the same thing we split this text because at the end of the day we just gonna we're gonna keep keep splitting and get the value after this joint so rather than we do both we do it at one shot okay so i put another if condition if the current item the three apple contains view did you notice i could see okay if it's the due date i already split the text right but i want to get the variable so let me copy this if it's a due date i trim it but i want to set the variable here as you d then i drag the else it will be d okay so from here i do need this and i don't need this as well because we already done it here so this is what i'm trying to make just now okay so um now we're going to make this more uh robust where after we get this value there's no point for us to keep continue looping because we're going to continue the next step right so we can use the next loop we write this next two over here once we get this value now we had this row right if we already find this we continue continuing this row we already find this value there's no need for us to do to do all the remaining checks we're going to continue to the next loop so which we start from here onwards okay so that's why we use this next loop and then let me drag here and let me drag here as well okay so now we're going to do the same thing for build two okay i want to copy this as if again two in one case and click save and then same thing i will do a split text my name is build two you repeat this the same following for for now we have built two right contact balance view and for subtotal text shipping and total we're just going to use a split by a space okay okay so this is done i'm gonna run this flow and you'll be able to see all the data type generated completely we take something to loop okay so it's done but you take a look here right the text actually it extract this value which we only want after the bracket so we can change this if you take like here right it's actually extracting the 19 so if you scroll down to text we can actually change this split text by a custom and we use this open bracket and save it will be able to extract everything so now let's double check balanced view then let's do the correct amount build two same and everything same date 15th gen due date and so forth okay so this is that's all for for uh part one okay we're going to continue on the part two [Music] you
Info
Channel: MS Power Automate
Views: 13,710
Rating: undefined out of 5
Keywords: microsoft power automate desktop, microsoft power automate, power automate desktop, power automate, power automate desktop tutorial, power automate tutorial, power automate desktop for beginners
Id: bhIclwHxSiY
Channel Id: undefined
Length: 13min 54sec (834 seconds)
Published: Fri Nov 12 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.