Parsing HTML tables from emails

Having used and become rather frustrated with paid platforms such as Zapier and Make I am seriously considering a move to self-hosted N8N. I have a general and not overly complicated set of use cases and, on first glance, it looks like N8N could be a good fit. But there is one specific requirement that isn’t leaping out as me as easily addressed and I am hoping someone can point me in the right direction.

There are two aspects to this.

  1. A trigger that responds to new emails, with a particular subject, being sent to the inbox of an Office365 shared mailbox.

  2. Parsing the contents (body) of the email to extract an HTML table and get it into a format (presumably JSON) that I can then easily reference in later steps in my automation.

I have not yet got 1 working but I am quite new to N88, so I am confident I’ll get this done (though pointers/suggestion are always welcome).

But 2 is more worrying. By comparison, Make has a nice node to extract and present an HTML table from an email. I don’t see anything so straightforward in N8N. Searching here brings up some suggestions about this type of functionality but I can’t see anything that came from these threads.

Does anyone have any suggestions for the node/features that might help here?

PS : I obviously have a preference to avoid using an external service/app to do this.

Hey @markw,

Welcome to the community :raised_hands:

It does sound like it should be possible, The first part is probably the easiest bit and I think you will have a bit of fun working on that so I won’t spoil anything there :slight_smile:

With the second part if no one else gets to this before tomorrow I will do a quick test and see if I can get an example together, It might just be a case of using the HTML extract node on the email body to get the data you want.

Thank you, @Jon. I appreciate the response. Although I had a few hiccups with the Office365 node (some weird stuff where the connection attempt never redirected back) I got there in the end. So that’s good!

I have been playing with the HTML Extract node. I suspect I still have some way to go to understand how N8N handles iterable JSON elements I see some light at the end of the tunnel. I am not there yet, but making slow but steady progress and enjoying learning as I go.

Thank you again.

1 Like