Using username from inbound email action to fill in Caller field.

gnunez
Kilo Guru

I currently use an inbound email action that captures the email in a web form outside of ServiceNow, but if the email isn't in a certain format it won't recognize who the caller is and will leave as blank. To avoid this I am trying to find a way to add to the script so it can capture the information using the username field. Is there any way to do this?

Thanks again!

1 ACCEPTED SOLUTION

Caller field is captured now. Had to add value pairs and then add that to the inbound action for Create Incident.


View solution in original post

44 REPLIES 44

It doesn't capture a name for the caller field. This is what it looks like:


find_real_file.png


Right, we're intentionally doing it to find out which user we're matching with. Do you know how to look up a user's sys_id? If not, can you replace Line 18 with below, so we can see who the user is?



current.short_description = grUser.next() ? grUser.name + ' ' + grUser.sys_id.toString() : 'User not found for ' + email.body.cin_employee_id;


I tested and got another user's name.


find_real_file.png


What's the field name for cin_employee_id [CIN/Employee ID] in the sys_user table? Can you confirm it?



And make sure Line 16 has the correct field name.