• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

Email Parser & Text Formatter [Text Parser]: Return Default Text if Body Text NOT Found

Hello, I am using email parser, with some required fields in the autogenerated emails, and others not.

To get what I'm trying to get, I'm attempting to use the Text Formatter, Text Parser option.

For example.

The email to be parsed could say:

Price: $12.50
Tip: $2.50
Item Name: Hamburger

OR

The Email parsed could only have:

Price: $12.50
Item Name: Hamburger

WITHOUT any Tip.



I want to capture the Price into a column in Google Sheets, called Price.

In emails that HAVE a Tip, I want it to capture the $2.50 (or whatever number).

I also want to capture the Item Name, in a column called Item Name in Google Sheets.



But if that text is NOT PRESENT in the email, I want Pabbly to put the default text of $0.00 into the Google Sheets column, instead of a blank value or nothing at all.



My problem is, the Text Formatter -> Parser, if I configure it for

AFTER
Price: $

and

BEFORE
Tip: $

If there's no Tip amount, and thus no Tip text in the email, it doesn't find anything for the Price, even though it is there.


And if I set up the Text Formatter -> Parser to

AFTER
Price: $

and

BEFORE
Item Name: $
(which are both required in the email)

Then if there's a tip, the Price number will also include the words "12.50 Tip: $2.50 ", which is also going to be wrong.


Any advice about how to successfully parse text, WHEN IT EXISTS, from an email, and IF IT DOESN'T EXIST, to simply submit default text, like 0.00 or nothing at all?

Thanks so much.

With peace,

- Omar
 

Supreme

Well-known member
Staff member
Hey @bro.omar.l.rashed

We looked into your workflow(UMZ_RLW _1_xxxxxxxxxxxxxxxxxxxxx_Google-Sheet ), checked the parser steps and it all seems fine now in terms to parse the price, tax.
But if that text is NOT PRESENT in the email, I want Pabbly to put the default text of $0.00 into the Google Sheets column, instead of a blank value or nothing at all.
And for this, you can establish router conditions, 1st when the body text contains the text which is required, and on another router, you can pretext the "0.00$".

For eg- If the body text contains required text

2021-10-08_17h17_07.png


2nd router when the body text doesn't contains the text (We tested for "Tax")

2021-10-08_17h17_23.png


For better understanding, you can refer to our tutorial video -


Thanks!
 
Top