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
I have three questions for you.
- Is the text always the same?
- Have you tried creating any workflows?
- Please mention, which platform you’re using (n8n Cloud, Docker, Desktop)
Hi @mcnaveen
- The format remains the same every time, but the text changes for each transaction (gift through CashApp)
- 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.
- 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:
- Fwd any cashapp email to a special “receiving” email box in Gmail
- Use imap to “read” this email
- The IMAP node yields both html and simple text. I opted to extract the text (seen in the above screen shot)
- 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!
2 Likes