Technical Articles

Review Cloudmersive's technical library.

How to Extract Invoice Tables using Document AI in Power Automate
11/3/2025 - Brian O'Neill


Cloudmersive Document AI is here, and it’s ready to revolutionize your document processing workflows.

Document AI empowers enterprises to intelligently summarize or categorize document contents, retrieve form responses, pull data from tables, and extract fields of data from invoices, receipts, tax forms, and other standard documents.

Cloudmersive Document AI Table Extraction in Power Automate

The Document AI API can be imported to Power Automate as a Custom Connector, and from there it can be plugged into any new or existing document processing workflow with ease.

In this article, we walk through an example Power Automate flow which takes advantage of the Document AI API’s table extraction capabilities to process items from an example invoice and return that data as a JSON object array. This simple flow allows us to ready invoice data for storage in an ERP, CRM, or database of any kind.

Uploading a Custom Document AI Connector to Power Automate

Before we get started, we’ll remember that implementing any Cloudmersive API as a custom connector in Power Automate is as simple as 1) uploading the API spec via JSON file or URL and 2) setting a host endpoint and base path in the General information tab of our custom connector editor.

1_Custom Upload Options

2_Set Host and Path in General Custom

We can set the endpoint to our deployed Document AI private or managed instance to take advantage of our existing infrastructure.

Extracting Table(s) from an Invoice in a Power Automate Flow

Once our Document AI custom connector is created, we can begin implementing Document AI actions in our flows right away.

In this example, we’ll build an Instant Cloud Flow with a manual file input trigger.

3_Select Instant Cloud FLow

4_Manually Trigger

We’ll configure our Manually trigger a flow trigger step to accept a file input. This will allow us to trigger this flow as needed with different invoice documents.

5_Configure manual trigger step with file input

Next, we’ll add a new action, navigate to the Custom connector tab, and select our custom Document AI connector.

6_Select Custom Connectors.

From the Document AI actions list, we’ll select the action titled Extract Tables of Data from a Document using AI.

7_Select Extract Tables of Data action

With the action opened in our flow, we’ll click Show all to enumerate the request parameters.

8_Show empty request params

As we can see in the empty example above, we only have 3 parameters to worry about in our table extraction request.

The RecognitionMode parameter allows us to specify how powerful the underlying AI model should be in our flow. The default setting is Advanced, which prioritizes accuracy over processing speed. The alternative option is Basic, which prioritizes speed over accuracy. We should ideally leave this setting at the Advanced default for best results.

The following two parameters simply capture the file bytes and file name from the current flow run. We can configure those parameters using dynamic content from the manual trigger upstream in our flow, as shown in the below completed request example.

9_Show filled request params

With only two steps, our flow is now technically ready to run as is; all that’s missing is a subsequent step which shares or processes the returned invoice data in some way.

We don’t have an example ERP, CRM, or database to send our data to in this test environment, so we’ll instead share the returned data with a SharePoint user through the Microsoft Teams connector. This will sufficiently demonstrate how easily accessible our invoice data is post-Document AI processing.

10_show finding teams connector

We’ll use the Post message in a chat or channel action to send a series of Flow bot messages to a Microsoft Teams user. Each message will contain the title of the invoice table the data was pulled from, along with the headers and values from that table.

11_Show example Teams message with table data

Notice that our Post message in a chat or channel action is wrapped in a series of nested For each loops in our flow. We should expect Power Automate to handle this for us automatically when our API response objects contain nested object arrays (as is the case with the Document AI API).

We’ll now save our flow and run it with an example invoice PNG file.

12_Show example invoice selected for test run

The actual example invoice used in this flow is included below for our reference:

Invoice Example

Reviewing Invoice Table Extraction Results

After running our flow with the above test file, we’ll receive the following response object JSON in our Extract Tables or Data from a Document using AI output:

13_Extract Tables Response Object

Since this object is cutoff in the above screenshot, we’ll find the full response object copied below:

Full response object

In the example response object, we’ll notice the quantity, unit price, and total cost of each invoice item was correctly broken down in a series of nested response object arrays. We’ll also notice the model did not find a table title because there was not one present.

In our example Microsoft Teams message, we can review how easily presentable this data is using the dynamic content values generated from our Extract Tables or Data from a Document using AI action.

14_Invoice Values Shared with Teams User

As shown above, all the invoice table data was successfully shared with the target Microsoft Teams user.

It’s important to make note of the empty Title of invoice table: field here. There wasn’t any table title available, and we never validated whether that data existed in our flow; as a result, we returned an empty value when we shared that content with the MS Teams user. This is easily avoidable in production flows with basic Condition checks.

Conclusion

In this article, we learned how to easily extract tables from an invoice document using the Document AI Extract Tables or Data from a Document using AI action. Our flow correctly returned the description, quantity, unit price, and total price of each item on the example invoice.

Including Document AI in our Power Automate flows immediately empowers our document processing capabilities. We can easily extract and subsequently share or store the data we need from invoice tables without needing to know anything about the structure of the invoice table ahead of time.

For expert advice on using the Cloudmersive Document AI API in Power Automate, please reach out to a Cloudmersive representative.

600 free API calls/month, with no expiration

Sign Up Now or Sign in with Google    Sign in with Microsoft

Questions? We'll be your guide.

Contact Sales