Managing emails can be time-consuming, especially when extracting data from messages and attachments. By combining AI Hub and Power Automate, you can create an automated system that can store data in Dataverse, send alerts, update dashboards, or initiate workflows based on the extracted information. This approach simplifies email management, saves time, and enables efficient workflow management.
In this blog, we will learn how to set up AI Hub in Power Apps for Document Data Extraction. Scenario: In this blog, we will cover how to select the desired fields (Text, Numbers, dates, etc.) and map them in your documents. This process also includes how to upload similar documents for the AI model to train on, so that it can extract accurate data from the documents.
Open Power Apps Portal and log in to your account. In the left-hand pane click on more and select AI hub.
Inside the AI hub select AI models.
In the AI models section select Documents and choose Extract Custom Information from Documents.
Click on Create Custom Model.
Choose the Fixed Template Document for quick training time (use only if all the documents received are of fixed format).
Click on Add, to start defining the fields you want to extract from your document. Review your document to identify the data you wish to extract, such as text, numbers, dates, or other specific information. From the available options, choose the field type that matches the data in your document.
Now enter an appropriate field name and press Done.
After adding the first field, continue adding all required fields by clicking Add, selecting the field type. Once all fields are added, click Next. Provide a collection of similar documents with a consistent structure for the model to train on, ensuring it can recognize patterns and accurately extract data.
Tag the fields present in the sample documents using the crosshair by selecting each field and assigning to its corresponding field added initially (In “choose information to extract” section).
Assign each field in the document to its corresponding field created earlier in Power Apps. Repeat this process for all other sample documents within the collection, ensuring all fields are appropriately mapped.
Finally train your model in the model summary section by clicking on the Train button.
After training your model, Publish the trained model to use it in power automate.
After Publishing the model click on Use Model and select Build Intelligent Automations to use power automate.
Now, Select Microsoft 365 Outlook Work Account as the source of the document.
Inside Power Automate Save the flow and Test it.
To manually test the flow, send an email to the email address associated with the signed-in Power Apps account and add the subject as “AI Builder” and add the necessary document.
If the flow executes successfully without errors, you will receive an email containing the fields extracted from the document.
Frequently Asked Questions:
1. What is AI Hub, and how does it enhance Power Automate workflows?
AI Hub is a low-code AI solution that enables users to integrate artificial intelligence into Power Platform applications. It enhances Power Automate workflows by enabling tasks like data extraction, sentiment analysis, and form processing, making automation smarter and more efficient.
2. How does AI Hub extract data from emails and attachments?
AI Hub uses prebuilt or custom AI models to analyse email content and attachments, extracting relevant data like text, numbers, or structured information, which can then be processed by Power Automate.
3. What types of email attachments can AI Hub process?
AI Hub can process various attachment types, including PDFs and images, if they meet the supported file formats for the AI model used.
4. How is the extracted data stored in Dataverse, and can it be accessed easily?
The extracted data is stored as structured records in Dataverse, making it easily accessible for further use in Power Pages, Power BI, or other applications within the Power Platform.
5. Can this integration handle multiple emails and attachments at once?
Yes, Power Automate can process multiple emails and attachments by iterating through email collections. This ensures all relevant data is extracted and stored efficiently.