Skip to main content

Hello, I am trying to extract an invoice number that is mentioned in the email subject (i.e. INV00001). And I do need the whole invoice number containing the INV plus 00001). 

Is this possible with a Python or Javascript, Regex or something like that? 

Thanks for help, 
Michael

@michael291

What is an example of the subject line template?

Article about using Formatter > Text > Extract Pattern: https://zapier.com/help/create/format/find-text-with-regular-expressions-in-zaps


Hi @Troy Tessalone the subject line is: 
Here is Invoice No. INV00001
Here is Invoice No. INV00002
Here is Invoice No. INV00003

etc.


@michael291

If the Invoice ID is always at the end just use a Formatter > Text > Split action to split at “No. ” and keep the second/last segment.


@Troy Tessalone Perfect!!! I did use Formatter > Text > Split > Use as separate fields to solve this problem. Many thanks!!!


Hello,

I have the same issue.

I want extract the order number. The order number is in the email subject like that : alibalabe : expeditition order n°234234254 _4396__

 

I need this number : _4396__

 

How can i do what i want ? 


Hi@Kenzo!

If you’re not familiar with code or using Extract Pattern, you could use a couple of Formatter steps:

  1. The first would split on the _ to get you 4396__ (you would use the last portion)
  2. The second would split on __ to get you 4396 (you would use the first portion)

A more efficient way would be to use something like this Formatter — Text — Extract Pattern step:

I used this in the Pattern field: \_(.*?)\__

Hope that helps!