Multiple events with one inbound email action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2023 03:22 AM
I am trying to create multiple events with a single inbound email action and the code I am using pasted below. Question is does it possible to create multiple events* from one inbound action as it only shows 1 target record when email received to SN. Also the code I have written is not at all working, tried logging depth and queue vales but even those are also not popping out on syslog table. Any troubleshooting steps or something I am missing here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2023 08:17 AM
It is possible to create multiple events using GlideRecord, but there can only be one target record which is created by using the current object. If you use current.insert() in the email record before creating anything else it will only create 1 record as current.insert() is seen as a 'break' in the Inbound Email Action. Run the code for creating the event in isolation in a background script and see if that is the problem. If it is not a problem, I would take a look at:
- Your WHILE conditions, should it be == (equals) instead of = (assigning a value). This is likely the problem and causing your GlideRecord code not to run.
- The MATCH variable doesn't look like it is assigned a value before it is used in the WHILE loop and to assign field values, take a look here as it may be the source of your issue.
My advice would also be, don't use Inbound Email Actions, and use Inbound Email Flows instead. You will have a far easier time looping and creating the records that you need.
