The digitization of business processes is not only a trend, but also increases the efficiency of a company. This allows you to quickly and easily automate processes that previously haven been done by hand. Two components of the Microsoft Power Platform provide just the right tools for this: Power Automate and AI Builder. In this article you will learn how to automate invoices.

What do I need for this?

Power Automate

In some articles on Microsoft Flow we have already showed you that a lot of problems can be solved with Power Automate. In short, it is always a matter of recognizing processes and pouring them into an automated flow.

AI Builder

Another feature of the Power Platform is AI Builder. This allows apps and business processes to be enhanced with artificial intelligence. AI Builder offers a number of different AI model types. These can, among other things, make predictions about specific events, identify objects and texts, and much more. In our example, we want to automate the processing steps for invoices. Therefore, the form processing model is of particular interest to us here. This allows us to extract key-value pairs from documents and images using machine learning and reuse them for our desired purposes.

Automate incoming invoices: that's how it works!

In order to automate the processing steps for invoices, we first need a flow, which we create with Power Automate. We start the flow manually by uploading a file. After that, the attached files are analyzed and added to our SharePoint library for invoices.

1. Create AI Model

Go to AI Builder on Microsoft’s Power Apps Site and select Build here.

2. Choose AI Model

Choose the form processing model from a number of possible models.

Name your model and you can start! Note that the documents that you need to train your model all have the same layout.

3. Provide information to be extracted

Create field names to contain the information that the model extracts from your documents.

4. Add documents

In this step, you upload at least 5 sample documents. Note that the layout must be the same for all documents! Once the documents are uploaded, they are analyzed by the model.

5. Tag documents

Tag the documents with the fields you set to extract the information. This works by marking the desired location in the document and choosing which field to assign the information to.

6. Train AI Model

Now it’s time to sit back and wait. It may take a few minutes for the model’s training to complete.

7. Publish AI Model

After the training you will be immediately redirected to the overview page. There you can now publish the model and use it in Power Apps or Power Automate.

8. Create Flow

We are not reinventing the wheel here, because there is a Microsoft template for reading and storing information from documents.

Simply click on Use model and select New flow. This flow connects to the common data service of your current environment. Now you can easily automate your incoming invoices!

The finished flow to automate invoices

With the created flow, you already have all the options you need to automate your invoice processes. Here’s what the finished flow looks like:

Here the flow is triggered as soon as a button is clicked. Unfortunately, you can’t use another trigger here at the moment, as only information from Forms can be processed by AI Builder. The Action Process and save information from forms provides us with the extracted information in order to be able to store the invoices automatically. We then upload the file to our SharePoint library and update the metadata with the extracted values. The whole thing looks like this in the library:

And that’s it! The metadata of our file was read correctly and automatically archived without knowing the contents of the document. The whole thing works super as you can see in my example above with American invoices, because date and currency formats are (still) better recognized. We are in the process of trying this out for a customer with Austrian invoices – but this is still a challenge.

Do you have similar requirements right now? Then contact us by clicking on the button.