Extract data from HTML tables from incoming emails?

daggupati
Tera Contributor

Hi Everyone,

I have requirement to parse out   the HTML tables and get that information put into separate fields. When the incoming emails are coming to our system, inbound actions will take the data in the incoming emails body and kept that data in the proper fields. In this picture this is the incoming email coming to Servicenow so i need to get the information of "street" kept that one in the field called "street" in the incident table. samething for other fields. I also read the couple of other articles but i couldn't figure it out.

@How can we extract data from tables in inbound email actions? @Inbound Email Action: - Extract data from an html table @Inbound email action to read data from HTML email

@chuck

find_real_file.png

Thanks in Advance.

9 REPLIES 9

SanjivMeher
Kilo Patron
Kilo Patron

Hi Ram,



Try getting the value by var street = email.body_text.indexOf('Street:') and see if you are able to get the street value. similarly try for other fields in the email.



Please mark this response as correct or helpful if it assisted you with your question.

Hi Sanjiv,



I tried that one. In the field it is store with '-1' but not the content of the field.




Thanks


daggupati
Tera Contributor

Any other suggestions?




Thanks


Ram


Hi Ram,



Paste the email to the below html converter.



https://wordtohtml.net/



identify the table ids and try using below link



Read table cell values(<td>) using table row(<tr>) id with javascript only - Stack Overflow



Please mark this response as correct or helpful if it assisted you with your question.