Best way to store Invoice OCR Results

Hello All,

I’m adding in an expense management feature into one of my bubble apps. Essentially, the user uploads a document(pdf or image) and it’ll upload it somewhere and also send it to an external OCR API service which will return I believe… json data with all the basic invoice info, document type, confidence, line items, quantity, item cost, calc cost, etc. At least that’s what I’ve experienced in the past with older-custom ML OCR models I’ve used. But in this instance I’m looking for another OCR AI API service (if anyone has any recommendations that’d be nice.)

So I’m wondering, what’s the best way to store that extracted data…I’d want to have UI indicators of confidence for the invoice in certain cases etc.

@redvivi has a lot of OCR plugins, worth a try:

Best way store would be in your database of course :grinning_face_with_smiling_eyes: Some datatype “Invoice” with probably lots of fields for the possible data invoices will have.

Then another data type “Invoice Item” with fields for the description, qty, price, and a Invoice field referencing back to it’s Invoice

1 Like

For expenses, best is a specialized OCR returning normalized fields such as

Or

Hmm, I guess that’s the most straight forward way to do it with Bubble. I felt no-sql document style might be more efficient in the long wrong, but maybe not.

I’d better get too it

No-SQL document style? I kind of just described how to store a list of Invoice Items, each with a reference to their parent Invoice :laughing:

1 Like

I’m using @redvivi Google Document AI - Invoice OCR, but I’m still having trouble with this. I can display the API results on a page, but I have not figured out how to extract each field and store it in a table. Can you help?

Hey @ben50 !

You need to filter out the response by the normalised fields you are interested in, mapped with the ones corresponding with your field in your database.

Please find an example on how to display a given field name and value on the demo application: Gcpdocumentaiinvoicedemo-editor | Bubble Editor

As this filter in the demo is done in a single statement, you may use even though you do not have any group or repeating group to refer to.

Ok, thank you, but I’m still running into trouble. Let’s say I’m looking to pull out the “receiver_name” , what should I filter to?

Also, where can I view the raw data of the API response?

The demo editor shows on the first page how to retrieve a value based on a given normalized field name.

Also, all the fields available is listed here: Full processor and detail list  |  Document AI  |  Google Cloud