pulling info from email to populate the short description

scottjus82
Kilo Guru

Hi

 

Using an inbound action I am trying to populate the short description with a line from the inbound email but my attempts have failed (again) I have tried using a script provided previously to be used in a record producer however thats failed. The email body will have the following lines, I want to pull the answers and add them to the short description stating New starter request for.....

 

 

First Name

Last Name

 

Any help would be greatly appreciated.

 

Regards

1 ACCEPTED SOLUTION

Have you tired using email.body.first_name (in lower case not upper case)



I think they may change the variables to all lower case when setting up the inbound integration.



Cheers,


Cameron


View solution in original post

19 REPLIES 19

marcguy
ServiceNow Employee
ServiceNow Employee

are you able to use this method?



Inbound Email Actions - ServiceNow Wiki



i.e.



firstname: Donald


lastname: Duck



then in your inbound use email.body.firstname to refer to First name and add to short description?


Hi



Thanks for the response. I have copied that if statement and changed it to reference the right fields however I am getting a sytnax error stopping me from saving the inbound action. My if statement is below along with the error I am getting



if(email.body.foo != undefined) {


    current.short_description = email.body.First Name ;



current.insert();



JavaScript parse error at line (13) column (52) problem = missing ; before statement




Any thoughts would be appreciated


Hi Steve,




Try changing First Name to firstname or first_name or anything without a Space.




current.short_description = email.body.First Name ;  


Hi Steve,



It's the space in the "First Name" that is causing this error.



You could rename it to be FirstName, to avoid this error. However, same should reflect in your email as well.



Also, since, it is FirstName that you're going to assign, change the if condition as



if(email.body.FirstName != undefined) {


current.short_description = email.body.FirstName;


}




Hope that helps.


Mandar