How to create an automatic receipt extractor using Cogniflow and Make

June 15, 2023
Blog Cogniflow How Artificial Intelligence Is Changing Business

In this article we will show how to create a workflow in Make that uses Cogniflow's OCR to extract info from receipts and send it to a spreadsheet.

Before we start make sure you have installed Cogniflow's app in Make, If not, please follow these instructions: Install Make Plugin.

First, let's add the Google Drive app and connect it to your account. I am using the action  "Watch files in a folder," so this scenario will execute automatically when a new receipt image is added to a specific folder.

Let's add then the OCR action from Cogniflow and connect it using your API-KEY. Then you only need to specify the format of the file and the "Web View Link" as the inputs to the AI model. Make sure the folder is publicly accesible in your Google Drive.

The model is going to return an list of all the texts found in the image so we need to iterate though the array to find the values we are interested. In this example I want to identify the total amount of the receipt. Typically the amount comes in the next position in the array were "Total" is found so first we need to identify the "Total" position.

Let's add an iterator and set it to the array of the previous step.

Now let's add the Google Spreadsheet action "Add Row" which we will set up later.

The trick here is to use a filter between the iterator and the Google Spreadsheet action, in order to execute only the last step only when the "Total" value if found, to get its position in the array.

Finally we need to use the "get" function from Make to access the item in the next position (+1) of the array from the item extracted with the text "Total".

Let's use the following receipt as a example:

When I run the scenario, the spreadsheet is correctly populated with the right amount:

In the coming weeks we are going to release a new model called "Smart Extractor" which is going to make lot easier these kind of extractions and quite more powerful. Stay tuned!

Marcelo Martinez CEO co-founder Cogniflow
Marcelo Martinez
Co-Founder & CEO @ Cogniflow AI

Want to learn more about No-Code AI and Machine Learning?

Thank you for subscribing to our newsletter!
Oops! Something went wrong while submitting the form.