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

Pulling a value from Incoming email to update a field when it creates INC

Tyler Johnson
Tera Expert

How do i pull a specific line value from the body of an incoming email to update a custom field when it creates a INC? 

 

There is a Line with a ID number in the body of the email, i created a custom field that is read only on INC, i am trying to pull just this line as the body contains alot of information. 

3 REPLIES 3

swathisarang98
Giga Sage

Hi @Tyler Johnson,

 

you can try something like below,

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;

 

or

You can refer below article ,

https://www.servicenow.com/community/developer-forum/inbound-email-to-get-values-from-the-users-emai... 

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

@Tyler Johnson, Thanks for marking my answer as helpful. If it helped you in any way please accept the solution so that it will be beneficial to the future readers with the same query

 

Thanks

Swathi

Anubhav24
Mega Sage

Hi @swathisarang98 ,

If the mail body simple plain text and then you need to extract value considering the email text is in a common format across all emails you might need to use indexOf(<expression>) and extract the line from there till the position of the text you need by using substring function.

 

Please mark helpful/correct if my response helped you.