Email logs is not updating the target field after an inbound email action is processed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2016 02:04 PM
Hello All,
I have created an inbound email action to Create a Request and Requested Item in Catalog when an email is received into servicenow. I have set Target Table as: Shopping Cart(sc_cart)
The Script work well and it creates a Request and Request Item. But my When i see the email logs from System Logs-->Emails and open the received email. Here the Target field is not populating the Requested Item or Request Number.
My Question is, Is there a way that i can populate the target field with RITM Number in the email log.
Any Pointers would be helpful !
Thank You
Rev@
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2020 03:19 AM
Hi Rev,
You can add below code at the end of inbound action to update "target table" and "target"
email_log.query('uid', email.uid);
email_log.orderByDesc('sys_created_on');
email_log.query();
if(email_log.next()) {
email_log.target_table = "sc_req_item";
email_log.instance=reqItemSysId;
email_log.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2020 12:43 AM
Thank you so much Rozi. I applied this code in my Inbound and now the Target field is populated with the record.
I highly appreciate!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2020 03:24 AM
Hi All,
Did someone find any solution for this?
Thanks,
Ruturaj