Inbound Actions- parse first name and last name from email body to populate Opened by field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2022 05:17 PM
Hi all,
I have a simple requirement in Inbound action where I need to pick up the email address from email body and populate the Opened by field of the Request record.
The email address in the body is a service now user and will have a record in sys_user table.
the email address in the email body will always have case owner as prefix.
Case owner: Ritu.sharma@xyz.com.au (from email) to Ritu Sharma in Opened by field
Case owner: Chris.martin@xyz.com.au = Chris martin in opened by field
- Labels:
-
Inbound actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2022 07:31 PM
Hi, if your email body matches your example then the Case owner may be available as a name:value pair
Setting field values from the email body (servicenow.com)
If not, you would normally use javascript substring() to parse out the email address from the email.body_text.
Accessing email object variables (servicenow.com)
JavaScript String Methods (w3schools.com)
Once you have an email address you can use GlideRecord to lookup your sys_user (or contact) table and match the email to a user record, then map this to your 'Opened by' user.
GlideRecord | ServiceNow Developers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2022 07:35 PM
It is also best practice NOT to use 2 forum accounts when asking questions\seeking support and doing so is less likely to result in a clear outcome to your question\issues.
Parsing email address from email body to populate ... - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2022 07:39 PM
Hi Tony,
Thanks for replying,
I will check your suggested solutions now.
I agree I thought I posted it the wrong forum and that's why I posted it twice.
I