Strip Email Attachments Inbound Action

wmahmud1
Kilo Explorer

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)

28 REPLIES 28

to restrict the option to emails.


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'

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


hhh3
Tera Contributor

current.table_name.toLowerCase().indexOf('zz_yy')

 

what we should give in place of zz_yy ?

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!