How to retrieve value from a table in an inbound action

ceraulo
Mega Guru

Hello ServiceNow Gurus,

I am creating an inbound action that processes incoming emails which always contain a table. One of the rows is similar to the screenshot below.

find_real_file.png

 

is it possible to retrieve this value and match the email address to a record in the User table? The User name will then populate the caller field in the Incident table.

Please help.

Thank you very much.

1 ACCEPTED SOLUTION

here we go 

 

sample code:

 

var abc = email.body_text;
var op=abc.split('Email');
var res= op[1];
var em= res.split('Sender');
var fr = em[0].trim();
gs.log('Result is'+fr);

 

give a try and let me know if you need any further help here. 

 

 

View solution in original post

8 REPLIES 8

did you try with below line to get the email value. 

 

var abc = email.body.Email;

gs.log('Email is'+ abc);

Yes, I did. The value returned is 'undefined'.

I missed one more detail. There will be more than 1 email address in the table. The requirement is to get the value for the 'Email' row.

find_real_file.png

here we go 

 

sample code:

 

var abc = email.body_text;
var op=abc.split('Email');
var res= op[1];
var em= res.split('Sender');
var fr = em[0].trim();
gs.log('Result is'+fr);

 

give a try and let me know if you need any further help here. 

 

 

This worked! Thank you so much.