Strip Email Attachments Inbound Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2015 11:45 AM
Hello -
I am trying to strip all attachments that get picked up by ServiceNow under 5000 bytes so we can avoid unecessary attachments of users signatures to records.
I have looked at some examples posted already and setup something similar. My issue is, the business rule on the sys_attachment table seems to run as I can see the script log showing the name of the file being aborted, but the email log itself, is not capturing the target (remains as empty) and not communicating back to the record. If i turn off this busienss rule, it works fine again.
Any ideas what the issue may be?
(see attached business rule detail)
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2015 08:26 AM
to restrict the option to emails.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2015 01:49 PM
I'm encountering the same issue as Chris above. Can someone explain why the process is failing with this line of code or what I'm misunderstanding?
I read it as "only strip attachments when the table name is not sys_email". When I look at the sys_attachment table, there's only a few that show a table_name of sys_email. I would have thought an attachment appearing on "new_call" for example would have been stripped with this line in the code, but that is not the case.. Incidentally, if I change it to == 'sys_email' the BR works properly. I must be misunderstanding something, I just don't know what.
current.table_name.toLowerCase() != 'sys_email'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2015 02:19 AM
Hi Scott, yes you are correct. I typed that line wrong.
it should be
&& current.table_name.toLowerCase() == 'sys_email'
to process just email attachments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2019 07:25 AM
current.table_name.toLowerCase().indexOf('zz_yy')
what we should give in place of zz_yy ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2019 07:41 AM
Whatever verbiage you're looking for. Like...if you're trying to find a certain keyword or whatever.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!