Best answer

How do I extract specific text from an email body to use as a subject line in Zapier?

  • 3 January 2024
  • 23 replies
  • 227 views

Userlevel 1
Badge +1

We are currently sending data to Zapier via email. Then, Zapier extracts the email address and sends it to our ticketing system as the user's email. This process initiates our helpdesk support.

 

How can I retrieve the text following the line "Problem?" from the body plain text, so that I can use it as the subject line for an email that is being sent through Zapier? The HTML text contains a short explanation of the issue following the "Problem?" line.

 

 

icon

Best answer by Troy Tessalone 5 January 2024, 03:07

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

23 replies

Userlevel 7
Badge +14

Hi @miconib 

We would need to see screenshots of the received email template to have context.

 

Check this help:

 

Userlevel 7
Badge +14

@miconib 

Try this Zap action: Formatter > Text > Split

Split at “Problem?” then keep the last segment

 

Userlevel 1
Badge +1

ok I'm making progress, but it’s keeping everything after new phone extension 

 

Userlevel 7
Badge +14

@miconib 

Most of that info looks like a previous email in the thread.

You can add another Formatter > Text > Split step to

Split after a new line

Keep first segment

 

Help: https://help.zapier.com/hc/en-us/articles/8496304469261-Modify-text-formats-in-Zaps#1-add-a-formatter-step-0-0

 

 

Userlevel 1
Badge +1

Ok, I’m sorry. I have tried this 10000 different ways I still get the same output as above it shows the output line I need, which is a new phone extension, but I don’t need anything after that. 

 

 

Userlevel 7
Badge +14

@miconib 

We would need to see updated screenshots with how your Zap steps are configured to have context.

 

 

Userlevel 1
Badge +1

 

Userlevel 1
Badge +1
Here is the output from a different record 

 

Userlevel 7
Badge +14

@miconib 

You need to add another Formatter step after Step 3.

 

 

You can add another Formatter > Text > Split step to

Split after a new line

Keep first segment

Help: https://help.zapier.com/hc/en-us/articles/8496304469261-Modify-text-formats-in-Zaps#1-add-a-formatter-step-0-0

 

 

Userlevel 1
Badge +1

Where do i put this at ? 

You can add another Formatter > Text > Split step toSplit after a new lineKeep first segment i’m sorry i’m not following and i have watched the video 

 

Userlevel 1
Badge +1

i added another step i just don’t understand the last part 

Userlevel 7
Badge +14

@miconib 

Can you be more specific about what you don’t understand and include updated screenshots with how your Zap step is configured?

Userlevel 1
Badge +1

 

Userlevel 1
Badge +1

specifically in the new step i created where do i put 

 

Split after a new lineKeep first segment

Userlevel 7
Badge +14

@miconib 

Check the field description for the Separator field and use on of the codes from the screenshot for newline. [:newline:]

You also need to set the Segment Index to be: first

 

Help: https://help.zapier.com/hc/en-us/articles/8496304469261-Modify-text-formats-in-Zaps#1-add-a-formatter-step-0-0

 

 

Userlevel 1
Badge +1

ok i put in the info, and the test on the formater work wooo hooo however it now gave me a different error on the send email :-( 

 

Userlevel 7
Badge +14

@miconib 

The \r indicate a return [:return:]

Subject lines in emails can’t have returns.

You can add another step: Formatter > Text > Trim Whitespace

 

 

Userlevel 7
Badge +14

@miconib 

FYI: Multiple Formatter steps can be replaced with 1 Code step to save Zap Tasks.

Userlevel 1
Badge +1

ok that works my god 6 steps. How would i go about doing it with one code stop lol I'm afraid to ask. 

 

By  the way THANK YOU THANK YOU 

Userlevel 7
Badge +14

@miconib 

Code is an advanced approach.

There is an AI feature in the Code step that you can try to use.

Or ask ChatGPT.

 

Userlevel 1
Badge +1

@miconib

Code is an advanced approach.

There is an AI feature in the Code step that you can try to use.

Or ask ChatGPT.

 

You rock man thank you so much for your help in getting me here. 

Userlevel 1
Badge +1

I’m sorry i just realized i was trying to mark your answer as the answer and I accidentally marked my comment. I just messaged the admin to see if they can fix it. Thank you so much 

Userlevel 7
Badge +6

I got you @miconib! I changed the best answer and passed it to Troy! Also, a big thanks to Troy for lending a hand here.

If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help! 🤗