[βœ… Solution] Extracting certain words from text

Hello,

Another head scratcher β€”

Im receiving emails that looks like this:

***** SYSTEM GENERATED MESSAGE *****

Your Credit Request for US Freight One Inc has been APPROVED for $10,000.00.

This approval is valid for 30 days. If you don’t factor an invoice within 30 days, the approval will expire and you will need to submit a new request.


Im trying to extract words:

  1. US Freight One Inc (it is always different company)

  2. $10,000.00 (also always different amount)

This is going in the body of the email and goes into email to app - into 1 field inside app that can be hidden and Im trying to display and use those 2 values above

Any thoughts ?

Assuming your email is called by @email

For the Name

@email.match(/Credit Request for (.*?) has been/)?.[1] || ""

And for the amount:

@email.match(/APPROVED for \$([\d,]+\.\d{2})/)?.[1] || ""

You can put these in calc fields in your item.

4 Likes

Works like a charm

Thank you

2 Likes