Pratiksha
Mega Sage
Mega Sage

The inbound email flow in ServiceNow streamlines the process of capturing, processing, and managing incoming emails within the platform, helping organizations to efficiently handle various tasks and requests.

 


Out of the box (OOB), ServiceNow's inbound email flow typically doesn't include the capability to directly read the email body for parsing or processing. Instead, the system primarily focuses on extracting key metadata such as the sender, subject, and attachments.

 

Yes, using a flow action like the one created by Ben Scherer from ServiceNow Share can indeed enable parsing of email bodies within ServiceNow. By leveraging this flow action, ServiceNow users can extract specific information from the email body and trigger subsequent actions or workflows based on that extracted data.

The flow action provided in the ServiceNow Share link allows users to incorporate custom parsing logic into their ServiceNow instance, enhancing the capabilities of the platform's inbound email processing. This can be particularly useful for organizations looking to automate the handling of incoming emails and extract relevant data to streamline their workflows.

By utilizing community-contributed solutions like the one provided by Ben Scherer, ServiceNow users can extend the functionality of their instances and tailor them to their unique business requirements without having to develop everything from scratch. This fosters collaboration and innovation within the ServiceNow community while empowering users to achieve their goals more efficiently.

 

 

 

Sharing one example how to use it.

 

 

Step 1 : Go to the provided link: Parse Email Flow Action on ServiceNow Share.

 

Step 2: Download the xml and commit the update set.

 

Step 3 : Once done you will be able to see the action in your instance :

 

 

 

Pratiksha_0-1707799260980.png

 

 

Step 4:  Add the action.

 

Pratiksha_1-1707799260986.png

 

 

Step 5: Drag and drop email record from the data Inbound email.

 

 

Pratiksha_2-1707799260987.png

 

 

 

Step 6 :  To populate a text field, you can directly utilize the extracted value from the parsed email body by assigning it to the field's value attribute. However, when aiming to populate a reference field, you'll need to introduce a variable to store the value extracted from the email body. Subsequently, conduct a lookup operation in the respective table to find the corresponding record based on this variable.

Pratiksha_3-1707799260990.png

 

 

Now, once you add the email variable, click on the function to add the key you want to extract from the email. In my case, I want to read the email as follows:

 

CI: [Server Name]

Alert Created Time: [Date and Time]

Alert description: [Description]

Be careful as it is case-sensitive. Next, you can do the lookup in the CMDB CI table with the name and then use the same while creating the incident.

Top of Form

 

Bottom of Form

Pratiksha_4-1707799260991.png

 

Special thanks to @Ben Scherer for sharing the wealth. 

 

Created a video for same. https://www.youtube.com/watch?v=wYnwEfcUNnU

Comments
Community Alums
Not applicable

Very useful article. Had a disappoint that inbound email flows does not suits for email body parsing. Now we can do that. No look back to inbound email actions 😝

Sandhya Gurram
Tera Expert

Great article for improving efficiency of Inbound email parsing with low code, very helpful @Pratiksha  👍

SK Chand Basha
Giga Sage

Very helpful article 

Bhuvana Komati
Tera Contributor

Thanks for sharing this @Pratiksha . It helps in my current project.

Priyanka_786
Tera Guru
Tera Guru

@Pratiksha  : Very helpful article. Thanks for sharing. Looking forward to use in upcoming client requirement.

Regards,

Priyanka Salunke

Priyanka_786
Tera Guru
Tera Guru

@Pratiksha  :  Thanks for sharing this article. I would like to use this in my client requirement. However I am trying in PDI, not working as expected for reference fields. Not sure, why. I am trying to fetch Opened by from email and in the key attribute passing opened_by. Could you please help me if it's wrong? Appreciated your help.

Regards,

Priyanka Salunke 

Pratiksha
Mega Sage
Mega Sage

@Priyanka_786 Please share the screenshot for step 6. Did you introduced a new variable? Are you getting the data in the variable? When you are doing lookup are you . walking to the email address correctly? 

Priyanka_786
Tera Guru
Tera Guru

Sure @Pratiksha  , Thanks for your response.  Please find the details as follows.

Yes. I have introduced new variable "Requested by" . I am not getting data in the variable. Doing lookup for sys_user table with name. Please find attached screenshots for your reference. I am trying to get Opened by value from email body text.

 

1. Screenshot of email body.

Priyanka_786_0-1711006452398.png

2.

Priyanka_786_1-1711006496109.png

3.  I am not sure why Key value is not getting saved.

Priyanka_786_2-1711006587065.png

4.

Priyanka_786_3-1711006665735.png

 

After testing showing error in lookup step. As not getting required user record because in previous step flow variable not getting opened by from email body text.

 

Hope it helps. Let me know if anything is not clear. 

 

Regards,

Priyanka Salunke

Pratiksha
Mega Sage
Mega Sage

If this is done on PDI then please share me user id and password in messages. I will check it tomorrow morning. 

Priyanka_786
Tera Guru
Tera Guru

Hi @Pratiksha  ,

Yes . I am trying on PDI.

Flow Name- test flow

PDI URL- https://dev79132.service-now.com/

Password- 8KvGQ^Nn/3im

 

Thank you.

Regards,

Priyanka Salunke

 

Sulabh Garg
Mega Sage
Mega Sage

@Priyanka_786 - Hi Priyanka, were you able to resolve the issue to populate the reference field through Email variable (Name/Value), I am also facing the same issue.

Any help would be appreciated.

Priyanka_786
Tera Guru
Tera Guru

Hi @Sulabh Garg , No, this issue is yet not solved unfortunately. I have followed required steps but some how it is not working for reference fields. I am not sure why. Actually I am also looking for help here. If it works then it will be game changer.

 

Regards,

Priyanka

Pratiksha
Mega Sage
Mega Sage

Hi @Priyanka_786 ,

 

The email should be in the key value format for example 

 
Assignment Team: Infrastructure Team
Alert Id: xxxxxxxxxxxxxxxx
Configuration Item: abc
Location:india
Alert Created Time: 17/01/2024 19:14:10
Short Description: abc Storage Alert: Percentage Logical Disk Free Space is low
Description: The disk 😧 on computer abc is running out of disk space. The value that exceeded the threshold is 0.84% free space.
 
 
 
Priyanka_786
Tera Guru
Tera Guru

@Pratiksha  : Thanks for your response 

I am trying to fetch value in same format email

Opened By: System Administrator 

 

Quick question: here how should pass Opened By in Key?

 

Regards,

Priyanka Salunke 

Community Alums
Not applicable

Hello @Priyanka_786@Pratiksha   I am facing issue to populate the reference field and Date/Time field through Email variable (Name/Value).

Pratiksha
Mega Sage
Mega Sage

@Priyanka_786 @Sulabh Garg Please check this out. Like and Subscribe  https://youtu.be/wYnwEfcUNnU

Pratiksha
Mega Sage
Mega Sage

@Community Alums  I just tried it works fine. 

 

Created a field on incident form date/time. 

 

variable name is date

 

The email body is : caller:abel.tuter@example.com

shortd:test
date:2024-05-06 22:23:17
 
It worked. 
 
Screenshot 2024-05-07 at 11.07.47 AM.png

 

Screenshot 2024-05-07 at 11.08.10 AM.png

 

 

Screenshot 2024-05-07 at 11.08.17 AM.png

please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

 

Regards,

Pratiksha


 

Erlan
Tera Contributor

How could I change the application of the imported xml file(Parse Email Flow Action), from global application to a custom application?

Pratiksha
Mega Sage
Mega Sage

@Erlan its a flow action. You can download and create it in the custom scope. 

Erlan
Tera Contributor

@Pratiksha I see, but how I could change the application of this custom action? Because I tried to do it manually in the xml file, changing the application tags, but it did not work. Is it possible to do it in the instance? if Yes. how could I could I do it?

aac31246
Tera Contributor

@Pratiksha I have ran into the issue on my PDI that the action is not returning any email variables I'm getting the following message in the logs *** Script: Cannot read property "1" from null am i missing some configuration on the action?

Pratiksha
Mega Sage
Mega Sage

@aac31246 I have not seen that error before. I have attached a video to the article. Please go through it. 

AbdulNow
Tera Guru

@Pratiksha 

It's not working for me as well, and my use case is the same: extracting the 'Requested by' email from the body text in the format below:

Requested by: Leigha Moyer (Leigha.Mottr@outlook.com).

 

What key value I should define in Set floe variable for this ? requested_by or anything

 

As of now I am not getting any return value

 

Could you please help me on this ?

 

@Priyanka_786  @Sulabh Garg  you got any solution on this ?

 

Regards,

Wahid

Pratiksha
Mega Sage
Mega Sage

@AbdulNow  it does work. I have added a video to the article. Please go through it. https://www.youtube.com/watch?v=wYnwEfcUNnU

EricG
Kilo Sage

@Pratiksha  

I've followed your instructions and downloaded the Email Parse action.

I'm getting the same error as @AbdulNow is when I process the emails either from the Mailbox or as a Flow Test.

EricG_0-1736538264869.png

 

The strange thing is, the Test will create the RITM and Update the original email, while the email box reprocess will not.

EricG_1-1736538412163.pngEricG_2-1736538438202.pngEricG_3-1736538460345.pngEricG_4-1736538492072.png

Here is the email i get.

EricG_6-1736538755667.png

 

As you can see, when tested I do get values.

EricG_5-1736538661841.png

 

Any idea why the mailbox processing isn't working like the Flow Test?

Manu el
Tera Contributor

Hello together, 

 

I'm facing some kind of weird issue. 

I watched the video and documentation over and over again.

 

I get the same error on PDI as well as on our DEV Instance in my company.

Manuel_0-1739626065101.png

Manuel_1-1739626094267.png

 

It looks like the output variable of the parse action itself is empty, but I've no clue why. 

 

Manuel_2-1739626170764.png

This is my parse action with the "Email Record" data record. 

 

Can anyone advice what to do ? Or someone faced the same issue ?

 

Thank you 

Best Regards

Manu

ollyivory
Tera Contributor

Great article and flow action.

However, is anyone able to help amend the regEx line to look for tags between []? The inbound email I'm trying to parse contains the following as an example:

[Service]SOP Application[/Service]

Version history
Last update:
‎05-24-2024 04:55 AM
Updated by:
Contributors