How to Parse Email Body text using Inbound Email in flow designer
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2025 11:10 PM
I have a requirement to auto submit a catalog item, based on the inbound email content. I have seen few links but seems they are all for plain text.
I get the data in below table format, need to retrieve those field values and map it to catalog variables and submit the catalog item.
| Contract ID | 4566 | 
| Contract Name | Test | 
| Vendor | TestXYZ | 
Can someone please assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2025 11:24 PM
Hi @Biso_Boby ,
you need to create a flow designer like shown in screenshot and set the field value using dot walk to inbound action-
and you can parse the body content like this-
my requirement is to get the content from body that is inside in double quotes- for that i have written-
Thank you
Nawal Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2025 11:25 PM
whatever you use inbound action or inbound flow, you will have to do string manipulation to get the content from HTML table
see these links and enhance your script as your table might be different.
Note: your script will only work when customer always replies in the same HTML table format
Get the values from HTML table from an email in a Inblund Action
How to parse "Employee Name" from Email Body Text via a Inbound Action to Caller field?
see this link for inbound flow parser for incoming email
Easiest way to Trigger Catalog Item Request via Inbound Email
also check this
Launch a #ServiceNow Catalog Item from Email via Flow Designer (LIKE A BOSS)
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2025 11:27 PM
Hi@Biso_Boby ,
You can parse table content from body text like this-
var body = email.body_html;
var pattern = /<tr>(.*?)<\/tr>/g;
var rows = body.match(pattern);
for (var i = 1; i < rows.length; i++) { // skip header row
  var row = rows[i];
  var cells = row.match(/<td>(.*?)<\/td>/g);
  if (cells && cells.length >= 3) {
    var name = cells[0].replace(/<\/?td>/g, '').trim();
    var emailAddress = cells[1].replace(/<\/?td>/g, '').trim();
    var phone = cells[2].replace(/<\/?td>/g, '').trim();
    var user = new GlideRecord('sys_user');
    user.initialize();
    user.name = name;
    user.email = emailAddress;
    user.phone = phone;
    user.insert();
  }
}
If you found my response helpful, please mark it as helpful and accept it as the solution.
Thank you
Nawal Singh
