reading email body from inbound email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023 11:39 PM
hi experts,
An email will be coming to servicenow and inside that email's body , there will be data. i have to read that data and populate it inside a table in servicenow.Can anyone tell how to read the data from the emai's body.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 12:17 AM
Hi! @Deepika54
The easiest way to parse the data could be via the plain text version of the body IE email.body_text, using basic java-script string methods.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 12:19 AM
Hi Deepika,
You can use the "email" object to obtain data from inbound emails:
email.body_text: Contains the body of the email as a plain text string.
email.body_html: Contains the body of the email as an HTML string.
Also for other values you can refer below :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 12:32 AM - edited 01-31-2023 12:39 AM
Create a standard format for users to set the data in the email body
For example, Set the following format in the email body
callerID : Test User
ShortDescription : Testing Inbound
You can access the data from the body as below
var incCaller = email.body.callerID;
var incShortDesc = email.body.ShortDescription;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 05:31 AM
Hi Deepika,
Please use the "email" object already provided. You can use this to get the body content in two ways : HTML or string format.
email.body_text: Contains the body of the email as a plain text string.
email.body_html: Contains the body of the email as an HTML string.
For other values form the inbound email , please refer below URL :