Skip to main content
Answer

How can I parse email subjects to create rows in Google sheets?

  • December 4, 2022
  • 7 replies
  • 294 views

Hello,

  1. I need to send zaps that create a row in Google sheet. 
  2. Colums are “email” |  “Subject”  | “Attachment”
  3. The email is always the same, it’s the system email. The subject line has 2 parts: The subject which is the same for all, and than another part of the subject line which is different in each email, and it’s the sender name. For example: subject: new form from ____ the line is the part that changes (sender name)

How do I set it in my zap trigger? 

Thank you,

Talia

Best answer by franimal

Hey @Talia 


Happy to help! So, as long as the subject line stays the same (other than name) a formatter step I think would be your best bet. Rather than split text, perhaps replace?

More info on replace: https://zapier.com/blog/zapier-formatter-guide/#replace  

Looking at a test I ran here.. 

You can see you have your subject line in the input, and we are asking the replace step to find the first half of the subject “reservation of movie theater by” and replace it with a space/nothing, so basically to delete it...


(view larger)

So when you pull out everything else, that should just leave, just the part that is different (the name) like this..


(view larger)

 

You can then use the output of the formatter, in that row in google sheets


(view larger)

 

Please give that a try :) if it doesn’t work, please grab a screenshot of what is going wrong so we can troubleshoot from there 

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

7 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • December 4, 2022

Hi @Talia 

Good question.

Try using this Zap trigger: Gmail New Attachment

 


  • Author
  • Beginner
  • December 5, 2022

Thanks but unfortunately it didn’t work. I need a trigger that has a sentence with a sentence that after it comes a different name. for example:

Subject:contact form from _______ the line stands for the variant that in each  subject line is different. 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • December 5, 2022

@Talia 

The Gmail New Attachment trigger will include the Subject of the email. (see screenshot example)

 

If you are trying to parse out data from the Subject, then you can use Formatter > Text > Split

 

 


chanelle
Forum|alt.badge.img+8
  • Zapier Staff
  • December 6, 2022

Hey there @Talia, Troy’s suggestion is on par for what I’d recommend as well. Were you able to give it a shot?


  • Author
  • Beginner
  • December 19, 2022

Unfortunately it didn’t work. Let me try to explain more:

Subject:Reservation of movie theater by John Doe

I need to separate the name John Doe because it is changed with every user. 

The zap configuration should create a row in Google Sheets with the colums: date and name (e.g. John Doe). 

date name
12/18/2022 John Doe
12/19/2022 Jane Doe

 

Thanks so much for your support and sorry for the late reply. 

Talia


rachael.silvano
Forum|alt.badge.img+7

Hi @Talia 

Hm, I’m curious if you can share with us the configuration of the action step of your Zap? Seeing how you have it set up in Google Sheets will likely provide our culprit with where you are getting stuck. 

 

Just a heads up before you post, we will need to have any personal info removed such as email, names, phone numbers. We hope to hear from you soon. 


franimal
Forum|alt.badge.img+3
  • Zapier Staff
  • Answer
  • December 20, 2022

Hey @Talia 


Happy to help! So, as long as the subject line stays the same (other than name) a formatter step I think would be your best bet. Rather than split text, perhaps replace?

More info on replace: https://zapier.com/blog/zapier-formatter-guide/#replace  

Looking at a test I ran here.. 

You can see you have your subject line in the input, and we are asking the replace step to find the first half of the subject “reservation of movie theater by” and replace it with a space/nothing, so basically to delete it...


(view larger)

So when you pull out everything else, that should just leave, just the part that is different (the name) like this..


(view larger)

 

You can then use the output of the formatter, in that row in google sheets


(view larger)

 

Please give that a try :) if it doesn’t work, please grab a screenshot of what is going wrong so we can troubleshoot from there