I have a Zap with four consecutive similar steps; two of those steps work and two of them don’t, and I can’t figure out why.
This Zap begins by taking an HTML email and converting it to Markdown. The relevant section of that email is as follows (proprietary information changed):
Customer: | **ACME Corporation**
Representative:| **John Smith**
Service Location:| **New York City**
Agreement Number:| **G123456**
The Customer line has a space between : and |, while the next three lines do not; I account for this in the expressions.
Using the Formatter Extract Pattern tool, I set up the following 4 steps, each using the output of the HTML to Markdown step as its input:
Step 5, meant to extract the Customer name:
Customer\: \| \*\*(.*?)\*\*
This works as expected, and returns:
output:
0: ACME Corporation
_end: 326
_matched: true
_start: 271
Step 6, meant to extract the Representative name:
Representative\:\| \*\*(.*?)\*\*
This returns:
output:
_matched: false
If I change the input on this step from the whole Markdown output of the email, to just the single Representative line, it returns John Smith as expected.
Step 7, meant to extract the Service Location name:
Service Location\:\| \*\*(.*?)\*\*
This behaves exactly as Step 6 - it returns false unless I input only the single relevant line of the email.
Step 8, meant to extract the Agreement Number without the leading letter:
\d\d\d\d\d\d
This works as expected, and returns:
output:
0: 123456
_end: 443
_matched: true
_start: 437
EDIT: I just realized if I change the expression here to:
Agreement Number\:\| \*\*G(.*?)\*\*
this step also returns false. It seems like it doesn’t like the lack of the space between : and |, I guess? I can’t imagine why that would matter.
================================
I’ve tested all four expressions using regex101.com and using the full Markdown email as test string, and all four returned the correct string.
In case there was some kind of order issue, I tried adding an additional step before the functional step 5, and recreated the Representative step there, and it still returns false.
While I didn’t paste the entire email above due to too much proprietary information, I can say that there is no other place in the email that contains either “Representative” or “Service Location” - and even if there were, it should return multiple matches instead of a false match.
I can’t imagine there’s some other content in the email causing the failure because steps 5 and 8 do work, and use the same input.
Is there something else happening here that I’m not seeing?