Text Parse Capability?

Hey there team! I find n8n to be a REALLY cool tool, and I’m starting to dig in. Question - is there an easy way to parse text? My church gets emailed notifications from CashApp, and I’d like to get two pieces of info into a Google sheet. Problem is, I’m not sure how to grab/save the info from the email I’ve pulled in: Any ideas?


1 Like

Hi @itpastor

Welcome to the n8n community :tada:

I have three questions for you.

  1. Is the text always the same?
  2. Have you tried creating any workflows?
  3. Please mention, which platform you’re using (n8n Cloud, Docker, Desktop)

Hi @mcnaveen

  1. The format remains the same every time, but the text changes for each transaction (gift through CashApp)
  2. Yes I’ve created one workflow, and i’ve managed to use regular expression to pull out one piece of data, but not the ones i really want.
  3. I’m using n8n self hosted in Docker.

Finally, I’m wondering if I should use an html extract node instead of a set node to get to this data.

Here’s my process:

  1. Fwd any cashapp email to a special “receiving” email box in Gmail
  2. Use imap to “read” this email
  3. The IMAP node yields both html and simple text. I opted to extract the text (seen in the above screen shot)
  4. Parse/extract text from there to get the info I’m looking for.

*Note - I have NOT tried using HTMLExtract - perhaps that’s the better option?

Everyone, I figured this out. Since the word “Subject” is on every single email, I was able to capture it with the following regular expression: /^Subject.*/gmi

In n8n, using a SET node, I am capturing that line with this expression:
{{ $json[“CashInfo”].match(/^Subject.*/gmi)[0] .toString()}}

Thank you to everyone - n8n Rocks!