- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 03:23 PM
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!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2017 01:57 PM
Caller field is captured now. Had to add value pairs and then add that to the inbound action for Create Incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 09:02 AM
I haven't stored multiple emails in a single field since all users in ServiceNow have their email associated to their account. Normally users log in to ServiceNow and submit their incident so it captures all their information, but this is the first time I am trying to have them submit an incident using our CMS webforms. I've added your code but instead of creating a ticket, a CALL is created so I know my email are off. I know you said to replace 'alt_email_1' and 'alt_email_2' with my field names from sys_user but right now there is only one field, which is Email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 09:13 AM
I'm not sure what you mean by "a CALL is created". The type of record being created should be set by the "Target table" field in the Inbound Email Action configuration page.
When your users use the CMS Webforms, is it a CMS page in ServiceNow? If so, do they login first to ServiceNow to use the form? Also, do they manually type in their email address in the form?
If you can just say Yes or No to the above questions, I'll have a better idea of the situation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 09:52 AM
The target table is set to Incident. Sorry my mistake it isn't creating a call instead it is opening an incident in name of another user (e.g. Kyle). I tested the form using different names but the incident is opened to the same caller (e.g. Kyle) with the original requesters information.
No it is a CMS page in Drupal.
I use the inbound action to capture all of their information to create an incident in ServiceNow.
Yes they manually type in their email address.
Thanks again for all your help! So close to finishing this!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 10:12 AM
OK, now it makes more sense. Instead of capturing email address, can you capture Student ID or Employee ID, which would provide better consistency and reliability?
If you still want to go with email as the key, you'll need to add additional fields in the sys_user table for matching.
Going back to your "Kyle" scenario, what happens if you use a known email that's in ServiceNow? If you're again getting Kyle's name, then we have an issue. If you're using an email that's NOT in ServiceNow and always getting Kyle's name, then we have a different issue.
Can you clarify which issue you're having?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 11:34 AM
Now that you mention it I think it would be more reliable to capture the Employee ID instead of the email.
I've added this snippet of code to the inbound action 'Create Incident':
if (email.body.cin_employee_id != undefined)
current.u_cin_employee_id = email.body.cin_employee_id;
Would I need to make any more changes to capture user information using the Employee ID?