Introduction
Sometimes, we have a scenario where we have a different layout for our invoices and forms. In this article, we will talk about how we can process multi-layout forms with the single AI builder form processing model. Let's get started!
The scenario and real-life use case
Let's consider an example of one of the finance organizations. They are generating a different invoice for each organization every month. The invoice layout is different for each company. During this entire article series, we will build our form processing a model with two different layouts of invoices, and based on that we will train our model. So, whenever we upload any new invoices from the power apps, it will pre-populate every field within the form and store all information within the SharePoint list.
Different Form Layouts.
Consider the following two invoices for the “Learn2All” and “PP Trainings” Organization.
Both companies have different Layouts
You can see here; some fields are available only within “PP Trainings” invoice.
Now, we need to build one generalize AI Model considering all the fields.
There are best practices we need to know before we get started!
Group documents with the same layout inside a collection. Don't use documents with different layouts in the same collection.
Use documents with primary text. Don't use documents with lots of images or checkboxes.
Use simple documents. Don't use files containing multiple documents.
Group documents with the same layout inside a collection. Don't use documents with different layouts in the same collection.
5+ documents with the same layout needed.
Overall Procedure for Form Processing
Step 1
Teach the model about your documents
Step 2
Tag documents and then train your model
Step 3
Publish and use your new AI model
Now let’s get started!
- Open Power Apps Portal.
- From Left Navigation Click on AI Builder and Expand Build Section.
- Click on Form Processing. Give the name for your Form Processing Model.
- Define Fields and Tables.
- Here, we will take the maximum no of fields from both invoices and define them by clicking on the + icon.
- In a similar manner, it goes to the Tables section and defines the table and its field. Click on the new Table and give the name of your table. It also defines all the columns.
- Click on Next.
- Click on New Collection.
- Change the name of the collection and click on the + icon to upload documents.
- Upload 5 documents for each type of invoice.
- We created two collections with both types of invoices and uploaded 5 documents in each collection.
- This will show the following pop up.
- Now, we need to tag our documents.
- Select any collection to tag documents.
- When we open invoices, this will show a dotted line around the detected words. Make sure you clicked on “Show detected words” from the top navigation.
- To tag the fields select fields and map appropriate fields like this.
- Follow the same procedure for all the fields.
- Now, to detect a table, click on the table icon and click on “Tag table”
- Then define each column as well for the table.
- Once all the fields from the form are detected this will show a blue tick like the below image.
- Follow the same procedure for all collection and all documents.
- If any of the fields is not a part of the form then, Click on the ellipses after the Form name and select “Not available in documents”.
- Once you train all documents, click on Next.
- This will show the model summary. Now, click on Train.
- This will show “Your Model is Training”.
- Click on “Go to Details Page”.
- Here, you can Quick Test the document. I’m uploading one sample.
- All the fields from “Learn2All” have been detected perfectly.
- Now, make sure the model is Published.
In my next article, we will learn how we can consume Form Processing AI Builder in Power Apps. Stay tuned to the next session.
Conclusion
This is how we can Build, Train, and Publish Multi Layout forms using a Single Form Processing AI Model. Happy Power Apping!