Skip to main content

I have regular emails in which the body has the following format:

 

Hi JOE SMITH,

ANDY JOHNSON has sent you $90.00 (CAD) and the money has been automatically deposited into your bank account at ABC Financial.

 

I have the process set-up, the email trigger works etc. the only step I need to figure out is getting the amount (90.00) extracted into a new row in a Google Sheet, and I am having a challenge with the regex to capture the 90.00.

Sometimes it’s 5 digits (instead of 90.00, it might be 550.00, etc.) and I need to ensure it can capture up to the 6 characters, three digits + period + two digits.

 

Thank you kindly for any help with this!!

Hi @CatsAndDucks 

Good question.

Here’s what ChatGPT by OpenAI provided:

 


Thank you! One more thing I would like is how to extract the name which would be at the beginning of the second paragraph of the body:

 

Hi JOE SMITH,

ANDY JOHNSON has sent you $90.00 (CAD) and the money has been automatically deposited into your bank account at ABC Financial.

 

So I would want “ANDY JOHNSON” and again this could be ANDY EDWARD JOHNSON so 2-4 words. I have tried loading ChatGPT but it says servers are at capacity so I cannot access it. Thank you for your help!


@CatsAndDucks

For the name, try using a Formatter > Text > Split

e.g. split (“ has sent”) and keep the first segment.

 

FYI: 1 Code step could be used to replace the multiple Formatter steps.

 

let Set = inputData.Set;
let Amount = Set.split("$")t1].split(" ")t0];
let Name = Set.split(",")t1].split(" has sent")s0].trim();

output = p{Amount, Name, Set}];

 

 


Thank you! Is there any way to use Zapier to extract from emails already sitting in my Gmail? So not for upcoming ones as they arrive, but if I had a label “transfers” and wanted Zapier to run a zap on all of them.


@CatsAndDucks 

These are the available Gmail Zap triggers:

 

Not all my emails are triggering my Zap

Each Gmail trigger has a specific length of time in the past that it can "see" emails in your Gmail account. If the email in question is older than the time limit, the trigger won't be able to detect that email.

These limits are as follows:

  • New Labeled Email - Unlimited
  • New Starred Email - 2 days
  • New Email - 1 hour
  • New Email Matching Search - 1 hour
  • New Thread - 1 hour
  • New Attachment - 1 hour

Please note that if you would like to trigger a Zap for starred emails that entered your inbox more than two days ago, you can use the New Labeled Email trigger and specify the STARRED label from the dropdown when setting up your Zap.


Tremendous! The “New Labeled Email” is perfect, you have been a massive help and I can’t thank you enough!