Best answer

How do you read file attachments in Gmail?

  • 15 August 2023
  • 4 replies
  • 295 views

I want to create a zap to read .json files sent via email and create a summary of them using ChatGPT. Ideally my flow will look like this:

  1. Gmail email received with label “Bug Report”
  2. ChatGPT parses unstructured data from the email (username, summary, etc)
  3. ChatGPT reads contents of stacktrace.json attachment and gathers the “root cause message”
  4. All data sent to a Google Sheet

Steps 1, 2 and 4 are pretty simple, but I can’t figure out the best way to get the email attachment into ChatGPT. Any ideas for how to approach this one?

icon

Best answer by Troy Tessalone 15 August 2023, 19:45

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Userlevel 7
Badge +14

Hi @particlepat 

Good question.

Try these Zap steps...

  1. Trigger: Gmail - New Attachment
  2. Action: Webhook - GET
    1. Map configure the URL as shown below
    2. Leave everything else as is
    3. This will return the JSON contents already parsed

 

EXAMPLE OUTPUT

 

Thanks Troy this worked great for me. Quick follow up if you have time, what if you have up to two attachments. Sometimes the json is attachment 1 and other times it’s attachment 2. I can create a path to look for when json exists in either attachment, but then I basically have duplicate zaps for each path. Curious if there’s a better way to handle that.

Userlevel 7
Badge +14

@particlepat

I meant to say use this Zap trigger: Gmail - New Attachment

 

You can add a Filter after step 1 to only process files with the desired conditions.

Oops I missed that step one. This all worked perfect fro me! Thank you.