October 14, 2024

Power Automate: extract text data from PDF and images into Excel with Cradl AI

Kavian Braanaas
Reading time: 5 min.

Start by cloning the Invoice model in Cradl AI

First, make sure you've created a free Cradl AI account - it's free to start!

Now, what kind of document are you working with? For this tutorial, I’m using the pre-trained Invoice model, but you can go with any template that fits your document type. Or create a custom template from scratch.

Next up—what data do you want to pull? Add or remove fields as needed. In my example, I ditched the IBAN and Line Item fields since I don’t need those in my spreadsheet.

Create an empty spreadsheet

With my AI model set up, it's time to create an empty spreadsheet which will receive the extracted data!

Make sure you host the spreadsheet in a file manager that integrates with Power Automate, such as Microsoft's OneDrive or Google's Drive.

Add headers that correspond to the fields you want to extract from your documents. If you're using Excel, select your columns and format them as a table.

Connect Power Automate to your Sheet

Now, let's hook up Power Automate with your new Excel file.

Start by creating an Instant Cloud Flow in Power Automate and set it to trigger whenever an HTTP request is received.

Since I want my extracted data to land in my sheet as rows, I’m going with the “Add a Row to an Excel table” action.

Connect Power Automate to your AI model

Let’s get Cradl AI talking to Power Automate so your data flows into Excel every time Cradl AI successfully extracts it.

In Cradl AI, pick Power Automate as your output destination. It’ll auto-generate a JSON schema based on your fields—just copy and paste that right into Power Automate.

Next, grab the Webhook URL from Power Automate, paste it into Cradl AI, and set the "Who Can Trigger The Flow" option to "Anyone."

Finally, choose the “Add a Row to an Excel table” action and match up the headers with the Cradl AI fields.

Run your flow!

Hit "Run" in Cradl AI, upload your documents, and let the magic happen.

Once the processing is done, open the documents in Validator and fix any errors the AI flagged. Then, just click "Validate," and boom—the whole flow from Cradl AI to Excel is triggered. Done!

Voilá! You’ve just nailed the easiest way to extract data from tons of documents straight into Power Automate.