PDF to Google Drive to OpenAI to Google Sheet

I’d like to create a scenario where a PDF statement that is uploaded to a Google Drive folder gets passed into OpenAI, certain data is extracted from the statement, and then that data is stored into a Google Sheet.

I’ve attempted to do this with a module that watches for new files a Google Drive folder, then another module that Downloads the file, and I’ve been attempting to send that file to OpenAI with no luck. I’ve tested extraction of the data I want from OpenAI using GPT4 and am able to get exactly what I need manually, but I cannot get the Make scenario to automate this flow.

I would be grateful if someone could explain the correct settings that are needed in the Google Drive Download module in order to pass the file to OpenAI.

Similarly, on the OpenAI step, I would be appreciative of details on the appropriate setup to retrieve the data that I want from the statement.

My prompt for OpenAI is this:
I want you to act as an accountant. You are tasked with handling inbound statements and extracting certain data from the statement. The data you are looking for is:

Account Number, the unique number associated with the statement
Statement Date, the date the overall statement was generated
Amount Due, the dollars and cents that the patient must pay

For the Account Number, record only the last 6 digits
For the Statement date, format to mm/dd/yyyy

Deliver the results as JSON in the format of:{ “accountNumber”: “000897, “statementDate”: “09/18/2023”, “amountDue”: “100.17” }

Welcome to the Make community!

You’re missing a Convert PDF to Text step, so that you can map it into the OpenAI module.

Which conversion integration/modules do you think can extract text from PDF files?

You can also see how others in the forum are doing it by using the search function.

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

2 Likes

@samliew thanks for the quick reply. My plan is to use OpenAI to extract the text I want from the PDF. I’ve tested manually uploading PDFs for ChatGPT with the prompt I used, and it works really well across many different PDFs. As a result, what I’m trying to accomplish is uploading the PDF directly to OpenAI with an automation whenever a new PDF is added to a specific Google Drive folder.

You’re missing an upload file to OpenAI step then.

That module will give you FileIDs to map into the Completion module.

For more information, see Search results for 'openai file assistant' - Make Community

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

2 Likes

@samliew thanks, looking at those threads though, people seem to be struggling with getting the correct settings on the Google Drive download step and then getting the Open AI 4 model to be available in the selections. I’m having those same issues. Is there any way you could show the exact settings for each module that would make this scenario work?

  1. watch a google drive folder
  2. download file from Google Drive
  3. upload file to Open AI
  4. create a prompt completion with GPT 4

Again, you cannot use Create a chat completion with files.

These are more relevant for you:

2 Likes

Same problem here: file upload with OpenAI works fine, but I have troubles piping the file into the assistant.


I was able to get this to work by inserting PDF.co in between. It’s not the most efficient scenario, but it works now.

2 Likes