Skip to main content
Best answer

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


Forum|alt.badge.img+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.

 

 

Best answer by Troy TessaloneBest answer by Troy Tessalone

@miconib 

Code is an advanced approach.

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

Or ask ChatGPT.

 

View original
Did this topic help you find an answer to your question?
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

Troy Tessalone
Forum|alt.badge.img+14

Hi @miconib 

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

 

Check this help:

 


Troy Tessalone
Forum|alt.badge.img+14

@miconib 

Try this Zap action: Formatter > Text > Split

Split at “Problem?” then keep the last segment

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 4, 2024

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

 


Troy Tessalone
Forum|alt.badge.img+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

 

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 4, 2024

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. 

 

 


Troy Tessalone
Forum|alt.badge.img+14

@miconib 

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

 

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 4, 2024

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 4, 2024
Here is the output from a different record 

 


Troy Tessalone
Forum|alt.badge.img+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

 

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 4, 2024

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 

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 4, 2024

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


Troy Tessalone
Forum|alt.badge.img+14

@miconib 

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


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 5, 2024

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 5, 2024

specifically in the new step i created where do i put 

 

Split after a new lineKeep first segment


Troy Tessalone
Forum|alt.badge.img+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

 

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 5, 2024

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 :-( 

 


Troy Tessalone
Forum|alt.badge.img+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

 

 


Troy Tessalone
Forum|alt.badge.img+14

@miconib 

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


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 5, 2024

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 


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 31497 replies
  • Answer
  • January 5, 2024

@miconib 

Code is an advanced approach.

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

Or ask ChatGPT.

 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 5, 2024
Troy Tessalone wrote:

@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. 


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 12 replies
  • January 5, 2024

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 


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • 6566 replies
  • January 9, 2024

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! 🤗