The CreatorCon Call for Content is officially open! Get started here.

Inbound email to get values from the users email body

Mr_X1
Tera Contributor

Hello Developer,

This would be the email body from client,

* Yellow marked 6 lines should be the updated in the worknotes/comment when incident is created via inbound email.
* Red Arrowed " Blue selected " : User ID should be selected as caller field & Opened by field in the incident created via inbound email.

Can someone please help on this, How to achive this task ?

 

find_real_file.png

8 REPLIES 8

Pranav Bhagat
Kilo Sage

You have to use regular expression for it .Can you please copy the body so that it helps us build the expression .

 

Regards

Pranav

 

 

Hello Pranav, Thank You for updating .

 

DO you have an example for this ?

You do not need to write regular expression script for this. As it is all prefixed with label:

 

From the docs:

For example, if an email body contains this line:

Foo:bar

The inbound email script creates the variable email.body.foo with the value of bar. You can use these variables to create conditions such as:

if(email.body.foo!=undefined){ current.[field]=email.body.foo;}



Reference:

https://docs.servicenow.com/bundle/paris-servicenow-platform/page/administer/notification/reference/...

You can try the examples provided by Willem and Jaspal .