Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Concnnect Drive with Document AI

How can I connect Google Drive to Document AI to extract information from invoices (like invoice number, amount, etc.) and store that information in a Google Sheet?

Solved Solved
0 2 158
1 ACCEPTED SOLUTION

Hi @Max024,

Welcome to Google Cloud Community!

To connect Google Drive to Document AI, here are some possible approaches you can consider to address the issue:

  1. Set up Document AI: If you haven't already, you'll need to enable and configure the Document AI API in your Google Cloud project. This involves creating a project, enabling the API, and setting up authentication (service accounts are generally recommended for server-side applications). Additionally, you'll need to create a processor specifically for invoices. Document AI offers pre-trained processors, or you can create a custom one if necessary.
  2. Access Google Drive: You'll need a way for your application to access files in your Google Drive, which requires setting up appropriate OAuth 2.0 credentials to grant your application permission to read the necessary files.
  3. Connect Drive to Document AI: To connect Google Drive to Document AI for invoice processing, make sure your code uses the Drive API to locate and download invoice files, then sends them to the Document AI API for processing. Document AI will return the extracted data, which your code can then utilize.
  4. Process the Document AI Response: The Document AI API will return a structured JSON response containing the extracted information. You'll need to parse this JSON to get the data you need (invoice number, amount, date, etc.)

Regarding the use of extracted information to populate a Google Sheet, I suggest filing this as a feature request. Please note that I can't provide any details or timelines at this moment. However, you may keep an eye on the release notes for any latest updates or new features related to Document AI.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

View solution in original post

2 REPLIES 2

Hi @Max024,

Welcome to Google Cloud Community!

To connect Google Drive to Document AI, here are some possible approaches you can consider to address the issue:

  1. Set up Document AI: If you haven't already, you'll need to enable and configure the Document AI API in your Google Cloud project. This involves creating a project, enabling the API, and setting up authentication (service accounts are generally recommended for server-side applications). Additionally, you'll need to create a processor specifically for invoices. Document AI offers pre-trained processors, or you can create a custom one if necessary.
  2. Access Google Drive: You'll need a way for your application to access files in your Google Drive, which requires setting up appropriate OAuth 2.0 credentials to grant your application permission to read the necessary files.
  3. Connect Drive to Document AI: To connect Google Drive to Document AI for invoice processing, make sure your code uses the Drive API to locate and download invoice files, then sends them to the Document AI API for processing. Document AI will return the extracted data, which your code can then utilize.
  4. Process the Document AI Response: The Document AI API will return a structured JSON response containing the extracted information. You'll need to parse this JSON to get the data you need (invoice number, amount, date, etc.)

Regarding the use of extracted information to populate a Google Sheet, I suggest filing this as a feature request. Please note that I can't provide any details or timelines at this moment. However, you may keep an eye on the release notes for any latest updates or new features related to Document AI.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

hi @ibaui 

Thanks!!!