Inbound Action Script - Duplicate Interactions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 11:11 AM
Hello!
We have an Inbound Action that creates an Interaction when an email alert is received. This is alert is set up to repeat every 2 hours if the issue persists.
I have a script that will check the Interaction table for a record with a short description that matches the email subject.
If an active Interaction record is found, add the email body to the interaction record as work notes.
If an interaction record is not found, create a new interaction.
The issue I am having is it is still creating an interaction regardless if there is a matching record. It does record the email body to the most recent record's work notes.
Any assistance is much appreciated!
Here is the script:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 11:29 AM - edited 06-19-2024 11:30 AM
Can you confirm that it is finding a matching record? I would recommend after your gr.query() to add a log statement such as:
gs.info('record count # ' + gr.getRowCount())
this will confirm you are returning a record. My guess is you aren't finding a record with your query. If that is the case, log your emailSubject variable and ensure you know what value you have. Also, using gr as your variable name for a GlideRecord query is not best practice, so I would recommend changing that to something more fitting.