- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have created a inbound action, when I send an email the inbound action is creating the case record which I can see on the email logs but the same record is not visible on the list or on the target field
Similar case I found below but no solution for this yet..
https://www.servicenow.com/community/csm-forum/created-a-record-by-inbound-action-but-not-showing-in...
@Tanushree Maiti @Ankur Bawiskar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
1)Refer KB: KB0547763 Empty Target record on processed emails
Cause
When an inbound action processes an incoming email, it uses the variable current to represent the record that it affects.
If a new record is to be created, then-current represents a new empty record for the target table suitable for the population before an insert.
1 2 3 4 5 6 7 8 9 10 11 12 | //Sample inbound action script creates an incident record current.caller_id = gs.getUserID(); current.comments = "received from: " + email.origemail; current.short_description = email.subject; current.category = "request"; current.incident_state = 1; current.notify = 2; current.contact_type = "email"; current.insert(); //<--When line completes, it will update the target |
If an existing record is to be updated, then current represents a reference to the record that is to be updated.
1 2 3 4 5 6 7 8 9 10 11 12 13 | gs.include('validators');
if (current.getTableName() == "incident") {
current.comments = "reply from: " + email.origemail;
if (email.subject.toLowerCase().indexOf("please reopen") >= 0) {
current.state = "2";
current.work_notes = "Issue was not resolved";
}
current.update(); //<--When this line completes, it will update the Target field |
If the script does not use variable current to update or create a record, the system does not know which record was affected and therefore is not able to fill in the Target field.
Resolution
- Whenever possible, use the already-provided current to update or create the target record.
Or: - If this is not an option because the script updates a record that does not belong to the Target table, or if you update/create more than one record, then consider manually logging the changes made by your custom action using gs.log() as described in product documentation.
1 2 3 4 5 6 7 8 | var grIncident = new GlideRecord('incident');
grIncident.initialize();
grIncident.caller_id=gs.getUserID();
grIncident.comments = "received from: " + email.origemail;
grIncident.short_description = email.subject;
grIncident.insert();
//create log entry to know what created/update by this action
gs.log("<custom_action_name> Created Incident:" + grIncident.number, "EMAIL." + sys_email.sys_id); |
You should then be able to view the record that was created or updated in the email logs.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
1)Refer KB: KB0547763 Empty Target record on processed emails
Cause
When an inbound action processes an incoming email, it uses the variable current to represent the record that it affects.
If a new record is to be created, then-current represents a new empty record for the target table suitable for the population before an insert.
1 2 3 4 5 6 7 8 9 10 11 12 | //Sample inbound action script creates an incident record current.caller_id = gs.getUserID(); current.comments = "received from: " + email.origemail; current.short_description = email.subject; current.category = "request"; current.incident_state = 1; current.notify = 2; current.contact_type = "email"; current.insert(); //<--When line completes, it will update the target |
If an existing record is to be updated, then current represents a reference to the record that is to be updated.
1 2 3 4 5 6 7 8 9 10 11 12 13 | gs.include('validators');
if (current.getTableName() == "incident") {
current.comments = "reply from: " + email.origemail;
if (email.subject.toLowerCase().indexOf("please reopen") >= 0) {
current.state = "2";
current.work_notes = "Issue was not resolved";
}
current.update(); //<--When this line completes, it will update the Target field |
If the script does not use variable current to update or create a record, the system does not know which record was affected and therefore is not able to fill in the Target field.
Resolution
- Whenever possible, use the already-provided current to update or create the target record.
Or: - If this is not an option because the script updates a record that does not belong to the Target table, or if you update/create more than one record, then consider manually logging the changes made by your custom action using gs.log() as described in product documentation.
1 2 3 4 5 6 7 8 | var grIncident = new GlideRecord('incident');
grIncident.initialize();
grIncident.caller_id=gs.getUserID();
grIncident.comments = "received from: " + email.origemail;
grIncident.short_description = email.subject;
grIncident.insert();
//create log entry to know what created/update by this action
gs.log("<custom_action_name> Created Incident:" + grIncident.number, "EMAIL." + sys_email.sys_id); |
You should then be able to view the record that was created or updated in the email logs.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
when you go on list there must be some query BR or CSM Query rule which must be blocking the record
Did you check with admin?
I could see you closed the thread by marking response as correct, but what was the solution?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- last edited
3 weeks ago
by
kh-christelle
This sounds like the record is being created successfully, but something is preventing it from appearing in the UI. A few things I'd check are:
-
Verify that the record actually exists in the table by querying it using its sys_id from the email logs.
-
Check whether any Business Rules, Data Policies, or Flow Designer actions are updating or deleting the record immediately after creation.
-
Confirm that the record matches the list filter conditions (for example, Active = true, Assignment Group filters, or domain separation settings).
-
Review ACLs and whether the user viewing the list has permission to see the record.
-
If the Target field is blank, make sure the inbound action script is correctly setting current and that current.insert() is returning a valid sys_id.
-
Also check whether the case is being created in an unexpected domain or with values that exclude it from the default view.
Since you can see the record creation in the email logs I'd start by capturing the sys_id immediately after insertion and searching for it directly in the table. That usually helps determine whether it's a visibility issue or whether another process is modifying the record after it's created.
[Message edited by mod - Link removed]